Solved

ErrDocument 403 does not work

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

863 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

26 Experts available now in Live!

Get 1:1 Help Now