My initial .htaccess allows access only to non-php files in a directory:
Order deny,allow
Deny from all
<Files ~ ".(xml|css|jpe?g|png|gif|js|pdf)$">
Allow from all
</Files>
I want to allow access now to one specific php file (relative path from .htaccess foo/bar/baz.php)
Tried adding
<Files foo/bar/baz.php>
order deny,allow
Allow from all
</Files>
also tried
<Files ~ "(baz)$">
order deny,allow
Allow from all
</Files>
How do I add access for this one file?
Can you try:
Order deny,allow
Deny from all
<Files ~ "\.(xml|css|jpe?g|png|gif|js|pdf)$">
Allow from all
</Files>
<Files ~ "baz\.php$">
Allow from all
</Files>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With