Forum Moderators: phranque

Message Too Old, No Replies

Can .htaccess password protect all but single file?

         

keeva_one

10:33 pm on Oct 29, 2004 (gmt 0)

10+ Year Member



I need to use .htaccess to (1) password protect ALL of my site but (2) NOT password protect the root index.php page.

(1) Easy enough for the first step. I password protected the entire site with:

AuthType Basic
AuthName "Client Only Web Site"
AuthUserFile "path"
require valid-user

(2) But, how do I explude the root index.php from being password protected? I know I could put the entire site in a folder but I don't want to remap all my URLS and server paths in my scrupts. I tried using somehting like this in the same root .htacces file:

<Files /index.php>
order allow,deny
allow from all
</Files>

I also tried this:

<Files /index.php>
order allow,deny
allow from all
</Files>

But that does not work. I've read [httpd.apache.org...] many times but can't make sense of it. Is anyone really familier with .htaccess containers that can help me out?

THX

jdMorgan

12:09 am on Oct 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



keeva_one,

Welcome to WebmasterWorld!

See the Satisfy any directive in Apache core documentation.
Don't forget to allow open access to robots.txt and your P3P policy, if you have one.

Jim