Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

htaccess - how do I allow read on just one file in a secured folder

Status
Not open for further replies.

kiwiplayer

Programmer
Aug 26, 2012
1
NZ
Hey there,

I'm trying to figure out the correct syntax for an htaccess file, any advice would be most welcome! The situation is:

I have a folder PRIVATE, which is secured by htaccess as password protected.
But in the subfolder PRIVATE/CLICKCOUNT (a utility script), is a php file that visitors need to access in order for the utility to work.

I tried creating a separate htaccess file in PRIVATE/CLICKCOUNT but an ID / password was still requested.

Then I tried adding this to the htaccess for PRIVATE:

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

but that doesn't work either - I still get a request for an ID / password.

I'm not sure what the syntax should be to correctly identify the click.php file to htaccess, I've tried various combinations without success - I'm not too sure that <Files> even permits a directory path!

Anyone got any ideas on what code should be in my htaccess file to make this work ...?

OK then,
Thank Q!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top