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]
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.
Hi Luke,
I found that setting RailsAllowModRewrite On works even if we don’t delete public/.htaccess