Created
February 2, 2016 20:34
-
-
Save akanik/f4b7351ce3636675f5df to your computer and use it in GitHub Desktop.
htaccess redirect naked domain
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
# To redirect all users to access the site WITH the 'www.' prefix, | |
# (http://example.com/... will be redirected to http://www.example.com/...) | |
# Make sure to replace example.com with your own site name | |
RewriteCond %{HTTP_HOST} ^example\.com$ [NC] | |
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment