Here is some code that will allow you to make all requests to your site have "www" in front of it.
All sites we host by default can be accessed with and without the www, but some of you would like "www" only style urlsURLs. Modify your .htaccess file with the following lines of code, using what is appropriate for your web server version.
Code:
Code Block |
---|
|
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L] |
In Apache 2.x you might try:
Code Block |
---|
|
RewriteEngine On
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com$
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L] |
Related articles
Content by Label |
---|
showLabels | false |
---|
maxspaces | 5GKB |
---|
spacesshowSpace | GKBfalse |
---|
sort | modified | showSpace | false |
---|
reverse | true |
---|
type | page |
---|
cql | label in ("www","url","redirect","mod_rewrite","htaccess") and type = "page" and space = "GKB" |
---|
labels | mod_rewrite redirect www url |
---|
|