.htaccess help?

.htaccess help?

Posted by: QuaLiTee80
Posted on: 2005-04-09 08:37:00

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!!!!!!!!

Re: .htaccess help?

Posted by: kchrist
Posted on: 2005-04-09 09:12:00

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.

Re: .htaccess help?

Posted by: ardco
Posted on: 2005-04-09 09:30:00

Also, you don't have to go to the "trouble" of specifying in your .htaccess file, since DH is setup to find them automatically in your domain's top level if you use the file names you did.

Error messages: https://panel.dreamhost.com/kbase/index.cgi?area=1120
401: https://panel.dreamhost.com/kbase/index.cgi?area=961
403: https://panel.dreamhost.com/kbase/index.cgi?area=2429
404: https://panel.dreamhost.com/kbase/index.cgi?area=160
500: https://panel.dreamhost.com/kbase/index.cgi?area=962

BobS

Re: .htaccess help?

Posted by: QuaLiTee80
Posted on: 2005-04-09 13:03:00

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?

Re: .htaccess help?

Posted by: ardco
Posted on: 2005-04-09 13:28:00

> 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.

Exactly, they're denied access.

> What am I to do?

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

BobS

Re: .htaccess help?

Posted by: QuaLiTee80
Posted on: 2005-04-09 18:39:00

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.

Re: .htaccess help?

Posted by: Atropos7
Posted on: 2005-04-09 19:00:00

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

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

Tags: htaccess fileipaddresssathtmldreamhostmy first timefaviconserver configurationforbiddendenyreadinghelproot directoryicotriescustom errorinternal errorerror log