Created
July 18, 2011 15:55
-
-
Save 8ig8/1089928 to your computer and use it in GitHub Desktop.
Force non-www URLs via .htaccess #htaccess
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
# Force non-www URLs via .htaccess file | |
# Rewrite all requests that include www (i.e. http://www.domain.com/page/) | |
# to non-www (i.e. http://domain.com/page/) | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment