Forum Moderators: phranque

Message Too Old, No Replies

Problem With My .htaccess file

         

JamesDean

10:48 am on Jun 15, 2005 (gmt 0)

10+ Year Member



Hi.

I'm having a weird problem with using my .htaccess file for password protection.

The script works if I put my .htaccess file in my main directory. The password prompt pops up when I browse www.mydomain.com

But if I put the .htaccess in a lower directory, nothing happens. When I browse www.mydomain.com./members/ no prompt pops up.

I tried typing jibberish in the .htaccess file. Still when I type in the address, it still seems to ignore my .htaccess file.

Anyone have an idea of what's going wrong here?

Thanks.

g1smd

2:23 pm on Jun 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




Did you restart the server? Might help to do that...

jdMorgan

2:54 pm on Jun 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also, flush your browser cache after making any changes to .htaccess.

If neither of these suggestions help, then it's likely to be either an AllowOverride or Options setting, or possibly the 'main' .htaccess file is interfering with the one in your subdirectory.

Jim

JamesDean

9:17 pm on Jun 15, 2005 (gmt 0)

10+ Year Member



Thanks.

I realized that I need an .htaccess file in my root.

As soon as I put a blank .htaccess in my root, the .htaccess in my "members" directory worked.

jdMorgan

11:37 pm on Jun 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, you might want to put something like this into that blank .htaccess file:

<FilesMatch "\.(htaccess¦htpasswd)$">
Order Deny,Allow
Deny from all
</FilesMatch>

unless you want people to be able to read .htaccess and .htpasswd files... :o

Jim