Forum Moderators: phranque

Message Too Old, No Replies

.htaccess and SetEnvIf

Custom ErrorDocument 403 don't work

         

fandangood

8:25 am on Mar 13, 2008 (gmt 0)

10+ Year Member



My .htaccess

ErrorDocument 401 /err_docs/authreqd.php
ErrorDocument 403 /err_docs/forbi.html
ErrorDocument 404 /err_docs/doc_notfound.htm
ErrorDocument 400 /err_docs/badreq.php

<Limit GET POST>
SetEnvIf User-Agent ^Java keep_out
SetEnvIfNoCase User-Agent "libwww-perl" keep_out
SetEnvIf Request_URI "robots\.txt$" allow_all
SetEnvIf Request_URI "err_docs/forbi\.html$" allow_all
order allow,deny
allow from all
allow from env=allow_all
deny from env=keep_out
deny from 63.148.99.
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

==========================
Error_log
[Thu Feb 21 21:31:09 2008] [error] [client 207.#*$!.74.82] client denied by server configuration: ../vhosts/mydomain.com/httpdocs/
[Thu Feb 21 21:31:09 2008] [error] [client 207.#*$!.74.82] client denied by server configuration: ../vhosts/mydomain.com/httpdocs/err_docs/forbi.html

Why don't work custom error 403 page forbi.html?

jdMorgan

4:20 pm on Mar 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your Order is incorrect. You should be using

Order Deny,Allow

so that Allows can override Denys.

You will also need to remove the "Allow from All" line.

See Apache mod_access documentation for details.

Jim