protect files
This commit is contained in:
@@ -1,13 +1,29 @@
|
|||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
RewriteBase /
|
RewriteBase /
|
||||||
|
|
||||||
## SSL
|
# SSL Enforement
|
||||||
# Enforce SSL
|
|
||||||
RewriteCond %{SERVER_PORT} !^443$
|
RewriteCond %{SERVER_PORT} !^443$
|
||||||
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST}
|
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST}
|
||||||
|
|
||||||
## Basic Auth protection
|
# Basic Auth protection
|
||||||
AuthType Basic
|
AuthType Basic
|
||||||
AuthName "secured area"
|
AuthName "secured area"
|
||||||
AuthUserFile /path/to/.htpasswd
|
AuthUserFile /path/to/.htpasswd
|
||||||
require valid-user
|
require valid-user
|
||||||
|
|
||||||
|
# Protect every file excluding CSS, JS, PHP and HTML
|
||||||
|
<Files *>
|
||||||
|
Order Deny,Allow
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
||||||
|
|
||||||
|
<FilesMatch ^$>
|
||||||
|
Order Allow,Deny
|
||||||
|
Allow from all
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
<FilesMatch "\.(css|js|php|html)$">
|
||||||
|
Order Allow,Deny
|
||||||
|
Allow from all
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user