Web Hosting Talk







View Full Version : htaccess problem, want to make a secure dir


Adriaan
03-13-2002, 04:56 PM
Hi,

I wanted to make a secure area using .htaccess file and .htpasswd file, but it seems the Cobalt doesn't look at the .htaccess file. As I added the line ErrorDocument 404 404.html and it didn't work.

So I went to cobalt-aid.sourceforge.net/files/ (http://cobalt-aid.sourceforge.net/files/) and installed the package "htaccess-allow.pkg" and checked if it was changed manually. Seemed to have no effect.

Someone any idea?

How does SSL work? Where can I find a manual to use this (with PHP)?

I hope someone could help me out here.
Much thanks,
Adriaan Mol

ASPCode.net
03-13-2002, 05:41 PM
1. Have you restarted Apache


2. That package sets AllowOverride to AuthConfig and this will mean .htaccess should work - but NOT error documents. You will need AllowOverride All to get that functionality - and believe me if you are hosting other clients on that server that's not good.

That mean they can override any setting you create ( could be php safe mode or something like that )

I solved ErrorDocuments by editing access.conf:

In the <Directory /home/sites/> area, add

ErrorDocument 400 /Error_Docs/400.html
ErrorDocument 401 /Error_Docs/401.html
ErrorDocument 403 /Error_Docs/403.html
ErrorDocument 404 /Error_Docs/404.html
ErrorDocument 500 /Error_Docs/500.html
ErrorDocument 501 /Error_Docs/501.html
ErrorDocument 502 /Error_Docs/502.html
ErrorDocument 503 /Error_Docs/503.html

This will allow all customers to create their own Error_Docs/400.html file etc under their web directory and have that working.

You might want to have CP autocreate these directories whenever you create a new site - I think that info should be available somewhere here on these forums.

Adriaan
03-14-2002, 06:32 AM
I restarted Apache.
I'll try some more on the sercure dir.

I want to show for all users another error document, does adding the line below in the access.conf will do?

ErrorDocument 404 /home/sites/www.mainsite.com/Error_Docs/404.html


Thanks alot for you support.

Adriaan