Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-21-2003, 09:39 AM   #1
Registered: Oct 2001
Location: Columbus, Ohio
Distribution: all.. but mainly SuSe--- looks like it changing to Red Hat
Posts: 119

Rep: Reputation: 15
.htaccess ErrorDocument and IE

OK... I know this question is not fully an Linux question.. sence I am asking info on IE.. but here goes...

I have set up apache... and in a test dir i have created a .htaccess file with the following line:

ErrorDocument 404 /error-404.php

Wich works fine in Mozilla.. it brings up the page..
in IE it does not.. It uses IE's default 404 page...

I do have a 404 page that does work..(html)... for the whole site...
but onece I have this entry in the .htaccess file.. it no longer uses the site 404 page.. or the php 404 page...

I have set this up at:

here some code if you want it


print "<br>\n Your IP address appears to be <b>$REMOTE_ADDR</b> <p>\n";

$SMURF = exec("host $REMOTE_ADDR 2> /dev/null | grep -i name | \
head -1 | awk '{print $5}'");
if ($SMURF != "")
print "This address maps to the name <b>$SMURF</b> <p>\n";
print "You appear to be running <b>$HTTP_USER_AGENT</b> <p>\n";

if ($HTTP_REFERER != "")
print "You readhed this page by clicking a link at ";
print "<b><a HREF=$HTTP_REFERER>$HTTP_REFERER</a>.</b><p>\n";
Old 02-21-2003, 02:20 PM   #2
Registered: Nov 2001
Location: London, UK
Distribution: Fedora
Posts: 161

Rep: Reputation: 43
Find out what Apache is actually sending. I use "wget -S --spider ..." to check the headers.

I think different IE versions do different things, but at the top of your PHP script you could try "headers('HTTP/1.0 400 Not Found');" and "headers('HTTP/1.0 200 OK');" to see how your browser reacts.

If you can't figure it out, find a site that does what you want and try "wget -S $URL" to steal it. Just set up the same headers in PHP. You may need to buffer the output (or build a string) if you need to send content-length headers.
Old 02-21-2003, 04:15 PM   #3
Obi Perrin
Registered: Nov 2002
Posts: 136

Rep: Reputation: 15
As far as I remember, IE rejects custom error pages that are under a certain size, and instead uses it's own. Try increasing the filesize of the page?
Old 02-21-2003, 06:17 PM   #4
Registered: Oct 2001
Location: Columbus, Ohio
Distribution: all.. but mainly SuSe--- looks like it changing to Red Hat
Posts: 119

Original Poster
Rep: Reputation: 15
Ding Ding Ding...

Thanks Obi Perrin,
You hit the nail on the head !!
I would have never in a million years thought of that.
I still am in disbelief... but it worked..

Thanks again..
Hopefully I can help you out some day...



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
invalid errordocument 404 /missing.htm singying304 Linux - Networking 3 11-29-2005 05:34 PM
ErrorDocument 404 invalid?! singying304 Linux - Networking 1 11-06-2005 10:31 AM
.htaccess -- ErrorDocument can't work with 401 error b:z Linux - Networking 1 05-26-2005 09:28 AM
htaccess not doing anything dpp777 Linux - Software 1 09-03-2004 01:24 PM
401 ErrorDocument with Apache c0c0deuz Linux - General 3 11-17-2002 07:43 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:18 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration