.htaccess help?


#1

hello, everyone!

i would like some assistance in using a .htaccess file. i have created one and added it to my root directory. although, it is reading the command to only allow from certain domains and ip…it is not reading my command to open up my custom error pages when someone outside of my allow list tries to visit my site.


here is my .htaccess file:
order deny,allow
deny from all
allow from 1.2.3.4.5.6
allow from .dreamhost.com

ErrorDocument 401 /qualitee80.com/forbidden.html
ErrorDocument 403 /qualitee80.com/forbidden.html
ErrorDocument 404 /qualitee80.com/missing.html
ErrorDocument 500 /qualitee80.com/internal_error.html


here is a my error.log:
[Sat Apr 9 00:31:31 2005] [error] [client ipaddress] client denied by server configuration: /home/qualitee/qualitee80.com/rnb
[Sat Apr 9 00:31:31 2005] [error] [client ipaddress] client denied by server configuration: /home/qualitee/qualitee80.com/errors
[Sat Apr 9 00:51:07 2005] [error] [client ipaddress] client denied by server configuration: /home/qualitee/qualitee80.com/.htaccess
[Sat Apr 9 00:51:07 2005] [error] [client ipaddress] File does not exist: /home/qualitee/qualitee80.com/errors/forbidden.html
[Sat Apr 9 00:51:07 2005] [error] [client ipaddress] File does not exist: /home/qualitee/qualitee80.com/favicon.ico
[Sat Apr 9 00:51:07 2005] [error] [client ipaddress] File does not exist: /home/qualitee/qualitee80.com/errors/missing.html


plase explain in laymen’s terms because my first time hearing about an .htaccess file was thursday.

i have read all the tutorials…did not help me at all!

THANKS IN ADVANCE!!!


#2

Your ErrorDocument paths should be relative to the web site root. So

ErrorDocument 401 /qualitee80.com/forbidden.html … should actually be:

ErrorDocument 401 /forbidden.html and so on.


If you want useful replies, ask smart questions.


#3

kchrist and ardco…thanks for your assistance!

If you have access to the site the error pages are working. For those ip address and domains that have been denied access the custom error pages still are not loading up. What am I to do?


#4

ARDCO, THANK YOU SOOOOOOO MUCH!

“Separate the main protected stuff from the custom error pages (separate directories), and allow access for everybody to the custom error pages.”

That statement was a huge help! Although, I did not know how to separate the directories, so they could be accessed by the denied ip or domain. I followed the instructions that you gave me earlier so I just uploaded the forbidden page to the free geocities site i signed up for so long ago.


#5

Example:

Domain = example.com
Web Directory = /home/username/example.com
Error Documents Directory = /home/username/example.com/error
Forbidden error document file = /home/username/example.com/error/forbidden.html

[code]File: /home/username/example.com/.htaccess

Prohibit access except visitors from x.x.x.x

Order deny,allow
deny from all
allow from x.x.x.x

Custom error documents

ErrorDocument 403 /error/forbidden.html

File: /home/username/example.com/error/.htaccess

Allow everyone access to custom error documents

Order deny,allow
deny from none
allow from all
------------------------------------------------[/code]
:cool: Perl / MySQL / HTML+CSS