Last active
December 11, 2015 06:08
-
-
Save vool/4556792 to your computer and use it in GitHub Desktop.
.htaccess rules
This file contains 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
######################################### | |
prevent script execution in directory | |
useful when access permissions and to be lax | |
IndexIgnore * | |
Options All -Indexes | |
# Secure directory by disabling script execution, add any extentions required | |
AddHandler cgi-script .php .php2 .php3 .php4 .php5 .php6 .php7 .php8 .pl .py .jsp .asp .htm .html .shtml .sh .cgi | |
Options -ExecCGI | |
# Don't show this file | |
<Files .htaccess> | |
order allow,deny | |
deny from all | |
</Files> | |
######################################### | |
www to non-www | |
#Requires RewriteEngine | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC] | |
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment