Link to home
Start Free TrialLog in
Avatar of mafairuz
mafairuzFlag for Oman

asked on

ErrDocument 403 does not work

I have the attached code in .htaccess
However, if someone from outside the IP range 96.10.*.* accesses the site, it shows him/her the standard forbidden error message rather than the load.shtml file!

How to fix this?

<Limit GET POST PUT>
order deny,allow
deny from all
allow from 96.10.*.*
</Limit>

AddHandler cgi-script .pl .py .jsp .asp .sh .cgi
Options -ExecCGI

# disable directory browsing
Options All -Indexes

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
RewriteCond %{QUERY_STRING} system [NC,OR]
RewriteCond %{QUERY_STRING} wget [NC]
RewriteRule .* - [F]

ErrorDocument 403 /errors/load.shtml
ErrorDocument 401 /errors/load.shtml

Open in new window

Avatar of sjklein42
sjklein42
Flag of United States of America image

Is there a chance that the ErrorDocument statements are being affected by the RewriteCond statements?

Does anything change if you put the ErrorDocument lines right after the RewriteEngine statement and before the first RewriteCond?
ASKER CERTIFIED SOLUTION
Avatar of mafairuz
mafairuz
Flag of Oman image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mafairuz

ASKER

I found my own solution