PDA

View Full Version : HTTP Error 403 - Forbidden



Carol.P
02-12-11, 02:21
HTTP Error 403 - Forbidden


We sometimes get 403 Forbidden error but we are not sure of how to fix it. It is because we do not know the exact reason for it. To resolve this issue correctly and quickly first thing we need to do is to check the error log and if we find any of the below given error we can work accordingly:


[Thu Apr 19 01:46:56 2007] [error] [client XXX.X.X.XX] client denied by server configuration: /home/user/public_html/file.php
We receive the above given 403 error due to a rule added in the .htaccess file. If you do not want to deny access to that IP XXX.X.X.XX (XXX.X.X.XX is the IP address) open the .htaccess file in the specific folder that generates the error and search for a line such as:

a)deny from XXX.X.X.XX
- this rule denies access from a particular IP, in this case it will deny access from the IP XXX.X.X.XX


b)deny from all
- this rule denies access from all Ips
If you find such a line you should delete it and save the changes. After that the client with this IP should be able to access the files in the folder and will not receive the "403 forbidden" error.


[Thu Apr 19 02:13:24 2007] [error] [client XXX.X.X.XX] Directory index forbidden by rule: /home/user/public_html/
Such error message will be displayed when ever a user tries to open a directory which has no index file and at the same time the Indexes option for this directory is turned off. In order to avoid this from happening, we need to make sure that the .htaccess file within the specified directory which displays this error does not contain a line like the one that is below:
Options -Indexes
To avoid any further risk just copy the above line in a note pad so that you can use it later on if you require it afterward. Once you have noted down the code you can remove it from the .htaccess file and save the changes.

jeremyc
03-11-11, 09:24
Hi

I really appreciate your efforts for posting such enormous tutorials, as they always being useful tips for all of us :)

Thanx

Carol.P
03-11-11, 21:58
Thank you for your kind words of appreciation.