Forum Moderators: coopster
i have added this
ErrorDocument 404 [*******.co.uk...]
to the .htaccess file withing the test folder and in the 404.php file i have the line of code
<?php echo $_SERVER['REQUEST_URI'];?>
which should show the url that was requested, but instead it just shows 404.php
what am i doing wrong
thanks
I think I’m missing something that’s obvious.
If I use this line of code (and it the only code) in the 404.php file
<?
echo "Document not found...\n<br>";
echo $_SERVER['REDIRECT_URL'] . "<br>";
echo $_SERVER['REQUEST_URI'] . "<br>";
?>
the 'REDIRECT_URL' displays nothing and the 'REQUEST_URI' displays
test/404.php
all help is much appreciated
thanks
ErrorDocument 404 /test/404.php
Using a full URL will usually make the server not respond with a proper 404. Check the response headers to be sure. If you use Firefox, Live HTTP Headers is a great extension for this.
Use ErrorDocument 404 /test/404.php as LunaC recommended.
Jim
i have replaced the full url in the .htaccess file so no it reads
ErrorDocument 404 /test/404.php
and have placed it within the test folder but i no longer get the custom 404 page.
edit...
i have just checked it in firefox and it works great but not in ie7?
in ie it just displays the standard
"The webpage cannot be found" 404 error message.
why does this happen how can it be solved?
thanks again
IE7 Tools->Internet Options->General /Browsing History->Delete->Temporary Internet Files /Delete Files
Jim
I cleared the cache but I still received to standard IE 404.
Then I read that IE won't display the custom 404 if the page size is too small? With the only code on the 404 page being what is above the page size was under 1KB, so I added some text to pad it out and it works.
I don't know why IE this does but it does
Thanks again for all your help
Cheers
Jim