Mailing List Archive

404 document does not show entered URL
Problem: When you ask for a missing URL at my site, you get the URL to my
"error_docs" page instead of the URL that you asked for.

To reproduce: try going to http://www.tntluoma.com/thisdoesnotexist/ and
you will end up at http://www.tntluoma.com/error_docs/not_found.html

I would like for the URL to be shown as
http://www.tntluoma.com/thisdoesnotexist/ so people can go to the address
and manually correct it if there is a small typo.

I tried Googling for the answer, but could not come up with any search
words that were giving me anything useful, even limiting the search to
www.apache.org or using the search feature at apache.org

Thanks for your time. If anyone knows the cause/solution, please let me
know (obviously, I guess ;-)

TjL

--
mailto: luomat@peak.org
Site: www.tntluoma.com
Info: Apache/1.3.19 (Unix) with PHP/4.0.6


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: 404 document does not show entered URL [ In reply to ]
On Sat, 23 Feb 2002, Timothy J. Luoma wrote:

>
> Problem: When you ask for a missing URL at my site, you get the URL to my
> "error_docs" page instead of the URL that you asked for.
>

Use a local url-path for your error-docs, rather than a full url starting
with http.

ie., use
ErrorDocument 404 /error/404.html

See the ErrorDocument documentation for more details.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: 404 document does not show entered URL [ In reply to ]
On Sat, 23 Feb 2002, Joshua Slive wrote:

> > Problem: When you ask for a missing URL at my site, you get the URL to my
> > "error_docs" page instead of the URL that you asked for.
>
> Use a local url-path for your error-docs, rather than a full url starting
> with http.

Ah! The site admin must have changed the site config. again without
telling anyone :-)

Nothing a local .htaccess couldn't fix

Thanks for the tip, I know have a much nicer 404 :-)

TjL

--
mailto: luomat@peak.org
Site: www.tntluoma.com
Info: Apache/1.3.19 (Unix) with PHP/4.0.6


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: 404 document does not show entered URL [ In reply to ]
You can also fix this by having your errordocument script
include a 'Status: 404 Not Found' line in its header fields.
Otherwise what is likely happening is that the client is
getting a 200 response because the errordocument was successfully
retrieved.
--
#ken P-)}

Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/
Author, developer, opinionist http://Apache-Server.Com/

"Millennium hand and shrimp!"

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: 404 document does not show entered URL [ In reply to ]
On Mon, 25 Feb 2002, Rodent of Unusual Size wrote:
^^^^^^^^^^^^^^^^^^^^^^
(from my wife's favorite movie ;-)


> You can also fix this by having your errordocument script include a
> 'Status: 404 Not Found' line in its header fields. Otherwise what is
> likely happening is that the client is getting a 200 response because
> the errordocument was successfully retrieved.

Ah... that's good to know. Unfortunately I do not (to my knowledge) have
access to the headers, as I am just a lowly user on this system.

Making it a /path/to/404doc.html worked for me.

Thanks
TjL


--
Site: www.tntluoma.com mailto:luomat@peak.org
Info: Apache/1.3.19 (Unix) with PHP/4.0.6
How does your webhost provider measure up to UCVHost?
See http://www.peak.org/~luomat/misc/tntluoma-uptime/


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: 404 document does not show entered URL [ In reply to ]
"Timothy J. Luoma" wrote:
>
> Ah... that's good to know. Unfortunately I do not (to my
> knowledge) have access to the headers, as I am just a lowly
> user on this system.

If the ErrorDocument document is a script, just add that to the
header emission portion. For instance, if it were a Perl script,
it might look like this:

#! /usr/bin/perl
#
print "Content-type: text/html; charset=ISO-8859-1\r\n";
print "\r\n";
print <<EOT
blah blah blah
EOT
exit(0);

Just change the top to look like this instead:

print "Content-type: text/html; charset=ISO-8859-1\r\n";
print "Status: 404 Not Found\r\n";
print "\r\n";
--
#ken P-)}

Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/
Author, developer, opinionist http://Apache-Server.Com/

"Millennium hand and shrimp!"

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org