I'm just trying out some 'free webs space' and you can't use the 404 or 403. A 404 error redirects to the hosts about us page. Is there a way with the .htaccess (or other??) to check if the page requested is in a list and if not go to an another file. I only have 6 pages in the website. In doing this would it cause any SE problems as I'm not sure a true 404 would be returned. I can't use the errordocument404 code Cheers Ian
If you have mod_rewrite enabled, you can check if the requested page exists and rewrite to a different file if not. Place this in a .htaccess file the root of your domain (domain.com/.htaccess). Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule .* 404.php [L] Code (markup): Change 404.php to whatever 404 error page you want. If you do use a script (PHP or otherwise), you can also send out a 404 response code manually so you don't confuse search engines or anything else relying on the returned status code. If you use PHP, you can just put the following at the very top (before any whitespace or output) of the error page and it'll send a 404 header. <?php header('HTTP/1.0 404 Not Found'); ?> PHP:
Still doesn't work, so I guess they have restricted the 404 a lot deeper in order for those errors to still be redirected to their website and not a 404 error page. Might have to think about some other code. ian