2015-07-10 09:43:19 +03:00
|
|
|
RewriteEngine On
|
|
|
|
|
RewriteBase /
|
|
|
|
|
|
2015-07-10 21:39:21 +03:00
|
|
|
# SSL Enforement
|
2015-07-10 09:28:49 +03:00
|
|
|
RewriteCond %{SERVER_PORT} !^443$
|
|
|
|
|
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST}
|
|
|
|
|
|
2015-07-10 21:39:21 +03:00
|
|
|
# Basic Auth protection
|
2015-07-09 00:06:31 +03:00
|
|
|
AuthType Basic
|
|
|
|
|
AuthName "secured area"
|
|
|
|
|
AuthUserFile /path/to/.htpasswd
|
|
|
|
|
require valid-user
|
2015-07-10 21:39:21 +03:00
|
|
|
|
|
|
|
|
# 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>
|
|
|
|
|
|
2015-12-11 19:39:52 +01:00
|
|
|
<FilesMatch "\.(css|js|php|html|htm|var|png)$">
|
2015-07-10 21:39:21 +03:00
|
|
|
Order Allow,Deny
|
|
|
|
|
Allow from all
|
|
|
|
|
</FilesMatch>
|
|
|
|
|
|