Forum Moderators: phranque

Message Too Old, No Replies

Condensing ErrorDocument directives

.htaccess

         

keyplyr

7:10 am on Nov 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is there a shorter way of doing this, since I am using the same pages? Thanks.

ErrorDocument 400 /error.html
ErrorDocument 401 /authentication.html
ErrorDocument 403 /forbidden.html
ErrorDocument 404 /error.html
ErrorDocument 405 /forbidden.html

jdMorgan

2:38 pm on Nov 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there a shorter way...?

Not that I know of.

For errors other than 403 and 404, you might just let the server use the default Apache error document, since human visitors are unlikely to "see" those. If you do use user-authentication, then you'd also want a custom 401 page, but otherwise, you probably only need 403 and 404.

Jim

keyplyr

4:52 pm on Nov 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




Thanks Jim. My host instead uses it's own spammy error pages, that's why I want to cover all the bases.

jdMorgan

5:25 pm on Nov 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right, then. May I have the spam, spam, spam, 403-Forbidden page, spam, spam, and spam without the spam, please?

... a take-off on an old Monty Python skit.

(Sitting here imagining a 404-Not Found Apache error page with Adsense on it for Viagra...) :)

In that case, you certainly want to handle them all yourself!

Jim