User login

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

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.