Forum Moderators: phranque

Message Too Old, No Replies

.htaccess and custom errorprob

         

garethjjones

2:33 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



Hi,

I've created an .htaccess file, and st up custom error messages. They all seem to work, except the 403 forbidden message when trying to access a script in the scripts directory.

Do I need an .htaccess in each subdirectory.

My .htaccess is
ErrorDocument 400 /errors/badrequest.htm
ErrorDocument 401 /errors/authreqd.htm
ErrorDocument 403 /errors/forbidden.htm
ErrorDocument 404 /errors/notfound.htm
ErrorDocument 500 /errors/servererror.htm

try http://www.example.co.uk/scripts/formmail.pl

thanks

GJ

[edited by: jdMorgan at 5:20 pm (utc) on Jan. 2, 2004]
[edit reason] examplified & de-linked [/edit]

garethjjones

2:34 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



if you click the link in the forum you don't get the rror - needs to be in the browser address bar!

GJ

Longhaired Genius

3:02 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



That is a custom error page so maybe it's being called by a higher level configuration file like Server Config or virtual host. Ask your host if they are taking steps to protect your scripts directory.

garethjjones

3:18 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



OK - though I doubt it as according to their faq's i can execute scripts from any directory - just used scripts so I'm clear where they are ;-)

jdMorgan

5:25 pm on Jan 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



GJ,

Welcome to WebmasterWorld [webmasterworld.com]!

> Do I need an .htaccess in each subdirectory?

No, not unless you need to override a setting made by a higher-level directory's .htaccess file.

Jim