Joomla SEO Blog by Pathos-Seo.com

Getting Joomla websites to reach their Full Potential by Optimization for Search Engines

 Joomla Optimization ar How to put the Joomla SEO puzzle together

Please give me a 404 Page!

I really, really want a 404 page for my Joomla sites!

I know, you can create one via a content page, if its a static or dynamic, and set that URL in the configuration of your SEF component…
Been there, done that.. even do for most of my sites anyway.

BIG problem with this is, not that I loose my visitor, because I make sure that it looks good and I give several options to choose alternatives to go into the site.

Biggest problem with the this option via Joomla and a SEF or redirect components is the fact that my Error page headers are wrong!!
No, not the text headers, my HTTP headers!
Check yours via this On-line Header Checker.

Yes I can create a separate file and set an Error document setting in my .htaccess file, works also, but not so good for me, I want my CMS to handle this file! 

Now if you use WordPress, you are fine, because WordPress gives you the right headers, and you can manage you Error pages mostly by editing you 404.php page that is included in the Template.

But for Joomla, whatever you do, you always get a status 200 OK, even if its wrong… because every thing goes via the index.php!
I would like to have the ability to edit my 404 page as a special page in Joomla itself, not depending on a SEF Component like Joomsef (who has it Build in….but I don’t like the Advertisements within the Component..) 

On of the problems this lack of a good 404 Error page is that, if you remove pages from you website, or change the URLs, they still keep popping up in the Search results pages…. Joomla says they have a status 200 OK so no need to take them out of the Index!

So if anybody knows how to solve this in an easy way… please leave a comment and I will test and come back on it..

Tags: Joomla! Please give me a 404 Page!

Inform the others...You know how..
  • del.icio.us
  • NewsVine
  • Reddit
  • YahooMyWeb
  • Digg
  • Furl
  • StumbleUpon
  • Technorati

Posted by Hummerbie on March 11th, 2007 ·

Related Posts

  • Open-Sef and Normal Joomla URLs
  • The importance of Visitor Tracking
  • Joomla Dynamic Page Title option for Improving Internal Linking
  • So you want to know how your Joomla site is on SEO?
  • Is Eleven better then Eight ?
  • Tags: Joomla · Joomla Design · Joomla Optimization · Joomla SEF · Joomla SEO · SEO · Search Engines

    Viewing 4 Comments

      • ^
      • v
      Easy to do! Create a 404 page for yourself using PHP - call it what you want depending its use e.g myerrordochandler.php. Change the System SEF to point to that file. Now the tricky bit. Explode the URL separating the url path and get_vars, check if this is something you want to handle or something you want a 404 page for.

      If you want to handle the page with actual content then ensure you put on the PHP statement header("HTTP/1.1 200 OK"); BEFORE ANY OTHER OUTPUT TO THE BROWSER!!! If anything has gone to the browser already you will get a 'headers already sent' notice

      If you want to send a real '404 page' to stop missing pages being indexed then put a header("HTTP/1.0 404 Not Found"); statement in your PHP. Same rule applies - no output before the header statement. You can ob_start() and ob_end_flush() to buffer your output until after the header is sent if you are so inclined.

      BTW if you have 404 redirection on a site you coded yourself (not Joomla etc) you can use .htaccess or httpd.conf settings to redirect to your ErrorDocument 404 handler (PHP or whatever your personal poison) and then use the header() function to tell the browser it is a real page not a 404 page! A very cool and completely standard way to create SEF - not like the Joomla junk way.
      • ^
      • v
      Interesting answer, but it refers to several points that it would be nice to develop to make it useful :
      1°) Which version of Joomla ? 1.0, 1.5 Legacy or 1.5 ?
      2°) How and where can i "Change the System SEF to point to that file"
      3°) Do you have an example for "the tricky bit. Explode the URL separating the url path and get_vars, check if this is something you want to handle or something you want a 404 page for."
      4°) I suppose "then ensure you put on the PHP statement header("HTTP/1.1 200 OK"); " is at the beginning of the template's index.php
      5°) header("HTTP/1.0 404 Not Found"); // is not written this way, i suppose, but wiht Location: ??? and how does it refer to myerrordochandler.php
      6°) How to "ob_start() and ob_end_flush() to buffer your output until after the header is sent if you are so inclined"

      Thanks for the input but I don't have your skill ans a working example would help very much !
      • ^
      • v
      All you've got to do really is read the following page

      http://docs.joomla.org/Custom_error_pages

      I got to it after checking your post... it includes stuff that @aeomer was talking about too.
      • ^
      • v
      @Bincom: True, the docs section is great for finding solutions for your problems.

      But for most Joomla webmasters this is to complicated. Using sh404SEF will give you the opportunity to modify your 404 page via a normal contant editing screen AND produce the right 404 error code for Joomla 1.5 and Joomla 1.0

    Trackbacks

    close Reblog this comment
    blog comments powered by Disqus