Custom 404 page gives 200 ok instead of 404 error

Everything to do with Joomla! 2.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
StanHigh
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Jun 08, 2015 6:37 pm

Custom 404 page gives 200 ok instead of 404 error

Post by StanHigh » Mon Jun 08, 2015 7:18 pm

Hi
I created custom 404 page by following the instructions on:
https://docs.joomla.org/Creating_a_Cust ... Error_Page
everything works perfectly it shows any article I want
But does not give error 404, it gives 200 ok, so goolebot thinks I`ve got endless quantity of pages
What can I do?

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4025
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: Custom 404 page gives 200 ok instead of 404 error

Post by itoctopus » Mon Jun 08, 2015 9:46 pm

We were faced with the same problem - since following the guide in your link will mean that no errors will show up in Google's webmaster tools (since no 404 HTTP error will be returned).

We have discussed the solution here: http://www.itoctopus.com/the-right-way- ... -in-joomla . Essentially you should use the "header" PHP function to send the right HTTP header (404) to the browser, you should then get the content of the 404 page using file_get_contents and then display it on the website when the page doesn't exist.
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter


Locked

Return to “Templates for Joomla! 2.5”