For example: http://www.ebuyer.com/flange
this url does not esist but when you visit the site it takes you to a search page where it has the search results for flange.
firstly i though that they had used .htaccess and ErrorDocumnet to point to a search script to return the search for what ever was in the url.
This is fairly easy to do, but what ihave noticed is that ebuyer responds with a 200 OK and my method responds with 404 Not found. The user will never see this but im guessing for SEO it would be better practice for this to return 200 OK.
how have they done this?
Thanks
You’re right that it is NOT done via ErrorDocument directive since that returns 404 status to the browsers. It is actually done via RewriteRule. See following example:
Which simply means if requested file or directory or link doesn’t exist on your web server then
internally forwardthe request to a script calledsearch.phpand pass requested URI as search parameterq. In the end aHTTP 200is returned to the browser instead of404.e.g.
/flangewould become/search.php?q=flangeinternally and return 200 to the browser.