Forum Moderators: phranque
I am trying to set up .htaccess and .htpasswd files to password protect the local root folder /Room111. So the full URL I want to protect is http://www.example.org/Room111, and I assume that it's okay to keep the .htpasswd in www.example.org.
I have tried to use online templates for the .htaccess but I don't think I have the path name right, and I don't even know if the server is recognizing the .htaccess file.
1)Is there a really simple command I could try to use in the .htaccess just to see if the server is reading it?
2)Can someone help me figure out the path names for the AuthUserFile line?
3)What should I do if it's not reading the file?
Please help this confused teacher out!
Seth W.
[edited by: jdMorgan at 5:19 am (utc) on Nov. 22, 2003]
[edit reason] Snipped specific URLs [/edit]
Welcome to WebmasterWorld [webmasterworld.com]!
1) Simple test code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^silly\.html$ /index.html [L]
The first line (Options ...) may or may not be needed; If it causes a 500-Server Error, then remove it. If it does not cause an error, you may try removing it later; there's no need to leave it in if the code works without it, and some servers need that line and some don't.
After installing the code in .htaccess in yoursite root directory, request the page yourdomain.org/silly.html. If the server returns your index page contents, then mod_rewrite is working. If you get a 404-Not Found error saying "silly.html" was not found, then mod_rewrite did not work.
2) The easiest way to find your authorization path is to ask your hosting provider or see if they have a frequently-asked questions (FAQ) page.
3) Again, ask your hosting provider.
Jim