In a web folder, I currently cannot access .txt
files via URL in browser. How can I modify my htaccess
file, so that files with type .txt
can be accessed via URL in browser?
Insert the code below in htaccess file:
<FilesMatch "\.(txt)$">
Order Deny,Allow
Allow from all
</FilesMatch>
This will permit access to all txt files. If you wish to deny all except one specific file:
Order Deny,Allow
Deny from All
<Files "view_only_this_file.txt">
Order Deny,Allow
Allow from All
</Files>
If adding the settings into your .htaccess file that Sergio mentioned isn't working, you may have to go straight to your VirtualHost entry. and add the rules. I'll let the more experienced apache folks here chime in, but that's where I would go.
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