From f0746e3178888ad0c380c6adfe882b45d43397be Mon Sep 17 00:00:00 2001 From: mxmehl Date: Fri, 10 Jul 2015 21:39:21 +0300 Subject: [PATCH] protect files --- .htaccess.sample | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.htaccess.sample b/.htaccess.sample index a4e108a..57c5ee8 100644 --- a/.htaccess.sample +++ b/.htaccess.sample @@ -1,13 +1,29 @@ RewriteEngine On RewriteBase / -## SSL -# Enforce SSL +# SSL Enforement RewriteCond %{SERVER_PORT} !^443$ RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST} -## Basic Auth protection +# Basic Auth protection AuthType Basic AuthName "secured area" AuthUserFile /path/to/.htpasswd require valid-user + +# Protect every file excluding CSS, JS, PHP and HTML + + Order Deny,Allow + Deny from all + + + + Order Allow,Deny + Allow from all + + + + Order Allow,Deny + Allow from all + +