我通常习惯使用.htaccess文件来强制域名使用www。 (即http://www.example.com代替http://example.com):部队www。 in rails
#Options +Indexes
RewriteEngine on
RewriteBase/
Redirect permanent "www.example.com" "http://www.example.com"
Redirect permanent "example.com" "http://www.example.com"
然而,这并不在Rails应用程序工作。什么是替代这个轨道?
问题是通过轨道客车忽略.htaccess文件。 – Chris 2009-12-16 13:00:32
没有它的工作,把它放在你的Rails项目的公共文件夹内 – khelll 2009-12-16 13:04:36
啊我不得不打开该域的mod_rewrite,但现在似乎工作正常。谢谢! – Chris 2009-12-16 13:36:05