Created
November 17, 2014 10:46
-
-
Save ChriRas/903d64450e99e6649d13 to your computer and use it in GitHub Desktop.
Apache htaccess/virtualhost rule to redirect 301 non-www version to www-version (to avoid duplicate URLs on search engines) e.g. example.org/one/two -> www.example.org/one/two
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
# .htaccess or Apache vhost | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^www\. | |
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment