Jump to content

.htaccess protection on all files but one


cgm225

Recommended Posts

I have the following directory structure

 

--ROOT

----includes

------php

------.htaccess

---------gallery

---------galleryFileCalledByJavaApp.php

 

I want to deny all for all the php files in the includes/php directory with an htaccess file at that level, except for one php file in a subdirectory that is called by a Java upload application.

 

Any ideas?  Thank you all in advance

Link to comment
https://forums.phpfreaks.com/topic/91987-htaccess-protection-on-all-files-but-one/
Share on other sites

You'll want to use the following configuration for the .htaccess file:

Deny from all # deny access to includes/php

# allow access to includes/php/galleryFileCalledByJavaApp.php only.
<Files "galleryFileCalledByJavaApp.php">
Allow from all
</Files>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.