Created
January 14, 2014 22:04
-
-
Save prcaen/8426744 to your computer and use it in GitHub Desktop.
Virtualhost configurations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Restrict access to website and fallback to password. | |
<Directory "/var/sites/SITE/"> | |
AllowOverride All | |
AuthType Basic | |
AuthName "Restricted Files" | |
AuthUserFile /var/sites/SITE/.htpasswd | |
Require user | |
Order allow,deny | |
Allow from 127.0.0.1 | |
Satisfy Any | |
Options +FollowSymLinks | |
RewriteEngine On | |
RewriteRule ^$ index.html [QSA] | |
RewriteRule ^([^.]+)$ $1.html [QSA] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ /index.php [QSA,L] | |
</Directory> | |
# Redirect mywebsite.com to www.mywebsite.com | |
<VirtualHost *:80> | |
ServerName example.com | |
Redirect permanent / http://www.example.com/ | |
</VirtualHost> | |
<VirtualHost *:80> | |
ServerName www.example.com | |
… | |
</VirtualHost> | |
# No index on files | |
<Directory "/folder/"> | |
Options All -Indexes | |
</Directory> | |
# .htaccess block | |
<Files .htaccess> | |
Order allow,deny | |
deny from all | |
</Files> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment