Re: Error Pages.

From: Date: Mon, 27 Nov 2000 23:39:16 +0000
Subject: Re: Error Pages.
Groups: php.general 
Request: Send a blank email to php-general+get-27502@lists.php.net to get a copy of this message
In a message dated 27/11/2000 17:18:27 GMT Standard Time, svaara@aitcom.net writes: << Hi, I'm trying to make a Errorpage that will display the wrongly entered request. For instance, domain.com/test.html and file doesn't exist it generates a 404 error, which I have a page for. How do I get my 404.php to point to domain.com/test.html or just test.html, either or. Using REQUEST_URI now, but it returns the 404.php (redirected uri) instead of the original one. Anyone know what I could use (tried http_referer too, didn't work). Sven-Emil Vaara >> Hi, I recently asked the same question and Chris replied with this explanation which worked just fine for me. Hope it helps :-) Ade **************Begin Copy*************** I have done this on a few sites that I have made. Of course the server has been Apache. This only works with Apache but it works really well, and it doesn't have anything to do with PHP but what the hell. In the root directory of your site, (www/htdocs/) or whatever... upload a plain text file called htaccess.txt with the following line of information. ErrorDocument 404 http://www.yourdomain.com/error404.html Make sure to create a html file called error404.html and save it to the same dir as the htaccess.txt file. Using your FTp program WS_FTP or whatever, while looking at the dir of your website, rename the htaccess.txt file to read .htaccess That is htaccess with a period "." in front of it. This hides the file, and makes it mean something to the server. There is a problem with IE however, and that IE4 or higher will still use its own 404 pages. You can overcome this by creating your 404 page larger than 512k. Just add a graphic, logo or something. IE then realises that there must be a new 404 file and uses your one. Thats it, type in a bogus URL at your domain and walla, your new custom error404.html file will be displayed. Need to know more about it feel free to email. Regards, Chris Sefton c.sefton@xtra.co.nz ***************End Copy****************

« previous php.general (#27502) next »