Its all about Ruby On Rails
Redirect all trafic comming to domain.com to www.domain.com using apache mod_rewrite
You may want to redirect all visitors to coming to your domain “domain.com” to “www.domain.com”. Most popular way to do this is using apache’s mod_rewrite module. You just need to add few lines in your apache’s configuration file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com$1 [R=permanent,L]
October 23, 2008 - 8:40 pm
And if you need to do this for Passenger (which disables mod_rewrite by default), simply delete the Rails public/.htaccess file and then enable the RailsAllowModRewrite configuration parameter.
October 24, 2008 - 10:36 am
Hi Luke,
I found that setting RailsAllowModRewrite On works even if we don’t delete public/.htaccess