Here is my .htaccess
file
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /myproject/
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
# Protect the htaccess file
<Files .htaccess>
Order Allow,Deny
Deny from all
</Files>
But still this file is accessible
domain.com/.htaccess
add comment
1 Answer
Generally dot file treated as secure file and it wont be accessible via url until explicitly rule overrride at server end.
in case, dot file (htaccess or env) file is accessible then simply you can revoke access putting this statement in your htaccess file.
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>
share
add comment
Your Answer
asked | |
viewed | 3 |
Related
- 2How to 'git stash' an untracked file?
- 1block access to single port with iptables except from one IP
- 8How to read PSD file format in C#?
- 0File transfer from Front to Back
- 0How to update marquee tag with a external text file..?
- 1What is the significance of, and reason for, wrapping the entire content of a JavaScript source file in a function block
- 1Import an SQL file using the command line in MySQL?
- 2withRef is removed. To access the wrapped instance, use a ref on the connected component
- 1Metadata file ".dll" could'nt found
- 0gzip file verification
- 0Is it possible to create a download link for a remote file in plain HTML, or with JavaScript or jQuery?