Solved

ErrDocument 403 does not work

Posted on 2011-02-27
3
423 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Rate limit for DNS queries 7 76
fedora linux on laptop - setup sendmail - or some kind of email 5 46
Linux Desktop suggestion for Dell Inspiron 3043 13 43
number in printf 13 27
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Fine Tune your automatic Updates for Ubuntu / Debian
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

825 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