2015-07-10 08:43:19 +02:00
|
|
|
RewriteEngine On
|
|
|
|
RewriteBase /
|
|
|
|
|
2015-07-10 20:39:21 +02:00
|
|
|
# SSL Enforement
|
2015-07-10 08:28:49 +02:00
|
|
|
RewriteCond %{SERVER_PORT} !^443$
|
|
|
|
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST}
|
|
|
|
|
2015-07-10 20:39:21 +02:00
|
|
|
# Basic Auth protection
|
2015-07-08 23:06:31 +02:00
|
|
|
AuthType Basic
|
|
|
|
AuthName "secured area"
|
|
|
|
AuthUserFile /path/to/.htpasswd
|
|
|
|
require valid-user
|
2015-07-10 20:39:21 +02: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 20:39:21 +02:00
|
|
|
Order Allow,Deny
|
|
|
|
Allow from all
|
|
|
|
</FilesMatch>
|
|
|
|
|