dynamic content redirection using 404 pages

I fixed a rather nasty bug in sillytech today, which had been stopping Google from indexing any of the user or thread pages. This happened because of how the user and thread pages work. You see they don't actually exist. There is no file on my webserver called '~dustin' and there is no file with the path '/threads/10' either. All of these pages are served to you through a bit of shifty work involving 404 error pages.

In a few '.htaccess' files (which are responsible for setting apache web server configuration) I have ErrorDocument 404 handlers setup. Then on the handler page the requested URL is examined (using PHP's $REDIRECT_URL variable). The page determines what it is that the user actually wants and outputs it to their browser.

The problem was that since it was being served through an error handler document apache would also send a HTTP status code of 404 (meaning page not found). SInce google doesn't appear to index things that return this code (sensibly enough) none of these pages were being searched by google. I believe that the problem has been corrected, by setting the status header directly from the error handler (in PHP it's done with 'header("Status: 200");').

Anyway, the reason that any of this is done is that I like having clean URLs.

Posted by dustin on January 12, 2004 with category tags of

1 comment
Whoowhaa?
   comment by stretch (#87) on January 12, 2004

   

VorgTag Cloud

Written by dustin
Latest Photo
Quote of Now:
Friends
Popular Posts
Computer Games

Hey You! Subscribe to dustin's RSS feed.
Or get wider opinion in the Vorg All Author feed.

 
 

Members login here.
© Vorg Group.