Last active
August 29, 2015 14:10
-
-
Save mayurah/0e74cd12fd544cd556c4 to your computer and use it in GitHub Desktop.
Apache httpd directives / .htaccess / httpd.conf
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
RewriteEngine On | |
# IP Canonicalization | |
RewriteCond %{HTTP_HOST} ^123\.123\.123\.222 | |
RewriteRule (.*) http://www.onezero.com/$1 [R=301,L] | |
# Libwww-perl Access Test | |
RewriteCond %{HTTP_USER_AGENT} libwww-perl.* | |
RewriteRule .* - [F,L] | |
# Redirect non-www requests to www | |
RewriteCond %{HTTP_HOST} !^www.onezero.com$ [NC] | |
RewriteRule ^(.*)$ http://www.onezero.com/$1 [L,R=301] | |
# For BasicAuth -- http://www.htpasswdgenerator.net/#results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment