|
|
View previous topic
::
View next topic
|
Author |
Message |
ramon fincken Site's programmer
 Get a free globally recognized avatar It's free!
Joined: 03 Aug 2007 Posts: 412 Location: A'dam/Diemen, The Netherlands
|
|
Back to top |
|
 |
Google adsense Advertisement
|
Posted: Mon Jul 07, 2008 8:01 pm Post subject: [solution] Adding "www." in front of your domain using htaccess rewrite rules ( modrewrite ) force |
|
|
Advertisement
|
|
Back to top |
|
 |
GravityForms Advertisement
|
Posted: Mon Jul 07, 2008 8:01 pm Post subject: [solution] Adding "www." in front of your domain using htaccess rewrite rules ( modrewrite ) force |
|
|
Advertisement
 |
|
Back to top |
|
 |
Site admin Site Admin
 Get a free globally recognized avatar It's free!
Joined: 03 Aug 2007 Posts: 3
|
Posted: Wed Sep 05, 2012 12:19 pm Post subject: Re: [solution] Adding "www." in front of your domain using htaccess rewrite rules ( modrewrite ) force |
|
|
Even better, for all names:
Code: | RewriteEngine On
RewriteBase /
# non empty HTTP_HOST in the request
RewriteCond %{HTTP_HOST} !^$ [NC]
# does not start with 'www'
RewriteCond %{HTTP_HOST} !^www\. [NC]
# saves the value of HTTP_HOST in %1
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
# redirects using the saved URI (in RewriteRule) and saved hostname (in the last RewriteCond)
RewriteRule ^(.*)$ "http://www.%1/$1" [L,R=301]
# that's it ! |
source:
http://drupal.org/node/93603 |
|
Back to top |
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|