PDA

View Full Version : .htaccess error


Kickin
07-12-2005, 11:00 AM
I have identical .htaccess files in two different directories. One works fine, the other gives an error. I want to deny access to all IPs except my office and a busines partner. The .htaccess does deny access on both directories, but only one shows "error.htm", the other says:

Forbidden
You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.



.htaccess file looks like this:

Order Deny,Allow
Deny from all
Allow from XX.XXX.XXX.XXX #My IP
Allow from XXX.XX.XXX.XX #Business Partner's IP
Allow from XX.XXX.XXX.X #Server IP

ErrorDocument 403 /error.htm

I don't know much about Apache or htaccess, but it seems pretty straight forward. Any idea why one works but not the other? I put the error.htm page in both directories.

schleppel
07-12-2005, 10:01 PM
I have no idea why it doesn't work, but unless you have another custom 403 page you could just put it (the ErrorDocument line) in a .htaccess file in the root directory.

Kickin
07-13-2005, 10:38 AM
Thanks for the reply schleppel, I tried it but it still works the same. It works fine for one directory but gives an error on the other. That makes me think the error may not actually be in the .htaccess file. I've contacted the host to see if they have had any issues from other customers, but would still appreciate any other ideas if anyone has some.

mrruben5
07-15-2005, 12:23 AM
Kickin, your error.htm is pointing to the root of the physichal filesystem, like (/home/kicking/public_html/foo/bar/)

Try putting error.htm in the same dir as where the errordocument is defined, and put a dot in front of the slash.

ErrorDocument 403 ./error.htm