Solved

ErrDocument 403 does not work

Posted on 2011-02-27
3
421 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
  • 2
3 Comments
 
LVL 16

Expert Comment

by:sjklein42
Comment Utility
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
Comment Utility
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
Comment Utility
I found my own solution
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now