Created
July 16, 2012 07:58
-
-
Save desarrolla2/3121439 to your computer and use it in GitHub Desktop.
Canonical Hostnames
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
# Description: The goal of this rule is to force the use of a particular hostname, in preference to other hostnames which may be used to reach the same site. For example, if you wish to force the use of www.example.com instead of example.com, you might use a variant of the following recipe. | |
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] | |
RewriteCond %{HTTP_HOST} !^$ | |
RewriteRule ^/(.*) http://www.example.com/$1 [L,R] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment