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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restricting Access to Certain File *Types*

Status
Not open for further replies.

borkazoid

Programmer
Jun 12, 2003
4
AU
Hi All,

I'm trying to configure an htaccess file on Apache so that I can protect a directory which looks like this;

Code:
www/
[URL unfurl="true"]www/.htaccess[/URL]
[URL unfurl="true"]www/index.html[/URL]
[URL unfurl="true"]www/page.php[/URL]
[URL unfurl="true"]www/admin[/URL]
[URL unfurl="true"]www/admin/config.php[/URL]
[URL unfurl="true"]www/css[/URL]
[URL unfurl="true"]www/css/style.css[/URL]

Basically, the problem that I have is that I need to be able to make the / NOT require authentication, but everything else in that tree to still require it.

I was hoping that I'd be able to do something like;

Code:
AuthName "Secured"
AuthType basic  
AuthDBUserFile /share/htacces/users.db  

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

<FilesMatch ~ &quot;\.css$&quot;>
  Order allow,deny 
  Deny from none
  Allow from all
</FilesMatch>

and thus require authentication, but allow requests to any file that ends in .css to be let through *without* authentication.

Can this be done?

Thanks,
Beau
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top