
In this short instructional exercise we will cover a htaccess deny admittance to document augmentation. we should examine about htaccess limit admittance to document augmentation. This article will give you straightforward illustration of htaccess deny admittance to php records in transfers organizer. bit by bit make sense of forestall direct admittance to php document htaccess. You simply need to a stage to done htaccess cripple document expansion access.
- Deny Access to .htaccess itself
# Deny access to .htaccess
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
To conceal every one of the substance of the catalog without illegal message, utilize the IndexIgnore order essentially.
# Hide the contents of directories
IndexIgnore *
To hide some filetypes only, use
# Hide files of type .png, .zip, .jpg, .gif and .doc from listing
IndexIgnore *.png *.zip *.jpg *.gif *.doc
3. Prevent access to certain files
Even if you remove directories and files from listing, they are still accessible if you type the path.
To remove unauthorized access to certain file extensions, use
# Deny access to files with extensions .jpg, .psd, .log, .sh,jpg
<FilesMatch "\.(?:inc|jpg|jpeg|rb)$">
Order allow,deny
Deny from all
</FilesMatch>
# Deny access to filenames starting with dot(.)
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>
You may also password protect files and directories and store the passwords in a .htpasswd file.
# Password protect files
<FilesMatch "^(execute|index|myfile|anotherfile)*$">
AuthType Basic
AuthName "Mypassword"
AuthUserFile <Full Server Path to .htpasswd file>/.htpasswd
Require valid-user
</FilesMatch>
It is best to participate in a contest for among the finest blogs on the web. I will suggest this website!