?
Solved

ErrDocument 403 does not work

Posted on 2011-02-27
3
Medium Priority
?
426 Views
Last Modified: 2012-06-21
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

0
Comment
Question by:mafairuz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Expert Comment

by:sjklein42
ID: 34992540
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?
0
 
LVL 3

Accepted Solution

by:
mafairuz earned 0 total points
ID: 34992575
The problem was that the deny option was restricted access to all files including the ErrDocument file.  So to resolve this issue, I had to create another .htaccess inside errrors folder and explicitly allow access from all to the file load.shtml

This has resolved the issue

Thanks sjklein42
0
 
LVL 3

Author Closing Comment

by:mafairuz
ID: 35034613
I found my own solution
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question