Click to See Complete Forum and Search --> : .htaccess prob for apache home web server


darkthreat
05-10-2007, 09:42 PM
I made a home web server and created an .htaccess file so the sit would be password protected, I have this:

AuthType Basic
AuthName "This is a private area, please log in"

AuthUserFile "C:\Documents and Settings\Administrator\My Documents\Secure Server Files\mypass.txt"
AuthGroupFile /dev/null

<Limit GET POST PUT>
require valid-user
</Limit>


in the .htaccess file, and mypass.txt had the user and encrypted pass.

However it doesn;t work, soi though my pass thing was wrong but it wasn;t. When I tried to create custom 404 pages, and i put:

ErrorDocument 404 /notfound.html

in .htaccess, it did not use the notfound.html file i had created.

What did i do wrong?

P.S. when saving htaccess, i told wordpad to save as all files and i typed in ".htaccess" as the name. this way it wouldn;t save it as a txt doc

P.P.S.

This is my whole .htaccess file:


AuthType Basic
AuthName "This is a private area, please log in"

AuthUserFile "C:\Documents and Settings\Administrator\My Documents\Secure Server Files\mypass.txt"
AuthGroupFile /dev/null

<Limit GET POST PUT>
require valid-user
</Limit>

ErrorDocument 404 /notfound.html



thx in advance

Handyman
05-11-2007, 11:27 AM
Your Apache config file (usually called httpd.conf) must have the required AllowOverride setting. To do user authentication and custom 404 pages make sure you have the following line in your httpd.conf file:

AllowOverride AuthConfig FileInfo

Right now you probably have:

AllowOverride None

Which tells Apache not to look for your .htaccess files.

Also, make sure Apache knows to look for .htaccess and not some other file name by checking for:

AccessFileName .htaccess