www .htaccess rewrite and Drupal multisite
keywords:
forward all to one url
RewriteCond %{HTTP_HOST} ^www\.tom\.com$ [NC]
RewriteRule ^(.*)$ http://tom.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.jerry\.com$ [NC]
RewriteRule ^(.*)$ http://jerry.com/$1 [L,R=301]
from http://exodusdev.com/multi-site-compatible-apache-rewrite-rules
Question: can the above be automated or universalized?
Something like RewriteCond %{HTTP_HOST} ^www$ [NC]
?
Another question: what about https?
All the single-site methods:
If you want to remove the "www." add this to your .htaccess file (this works for Apache). If you don't have a .htaccess file create one with this in it.
| RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]|
WWW or No WWW, that is the SEO Question
<http://www.mattfarina.com/2007/07/24/www-or-no-www-seo-question>
RewriteCond %{HTTP_HOST} ^www.OpenSourceCommunity.org$ [NC]
RewriteRule ^(.*)$ http://OpenSourceCommunity.org/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
keywords:
forward all to one url
RewriteCond %{HTTP_HOST} ^www\.tom\.com$ [NC]
RewriteRule ^(.*)$ http://tom.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.jerry\.com$ [NC]
RewriteRule ^(.*)$ http://jerry.com/$1 [L,R=301]
from http://exodusdev.com/multi-site-compatible-apache-rewrite-rules
Question: can the above be automated or universalized?
Something like RewriteCond %{HTTP_HOST} ^www$ [NC]
?
Another question: what about https?
All the single-site methods:
If you want to remove the "www." add this to your .htaccess file (this works for Apache). If you don't have a .htaccess file create one with this in it.
| RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]|
WWW or No WWW, that is the SEO Question
<http://www.mattfarina.com/2007/07/24/www-or-no-www-seo-question>
RewriteCond %{HTTP_HOST} ^www.OpenSourceCommunity.org$ [NC]
RewriteRule ^(.*)$ http://OpenSourceCommunity.org/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
Comments
Saved my day
Hi, you saved my day! Now my HTTPS is working like a charm.
Post new comment