I'm facing a redirect problem. I have a farm that hosts many different
domain names and I would like to find the best way for my farms to scale
automatically.
I want to set up a redirect from all my http://domain.tld to their
respective http://www.domain.tld

Here are the two methods I found. Maybe you got other methods to share.

*mod rewrite*
<VirtualHost *>
ServerName www.yourdomain.com
ServerAlias www.yourdomain.com yourdomain.com
RewriteEngine on
RewriteCond %{HTTP_HOST}                !^www.yourdomain.com(:80)?$
RewriteRule ^/(.*)                      http://www.yourdomain.com/$1[L,R=301]
</VirtualHost>

*redirect permanent*
<Virtualhost *>
ServerAlias yourdomain.com
redirect permanent / http://www.yourdomain.com/
</Virtualhost>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"scalr-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/scalr-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to