我该如何做到这一点http://domain.com 301重定向到http://www.domain.com?我习惯使用.htaccess来ModRewrite它,但是我知道我不能在Heroku上做到这一点。的.htaccess的Heroku 301重定向
例子:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
我的文件结构:
- /public
--- /style
--- index.html
- config.ru
我刚煮好的单页,和我config.ru由这样的:
use Rack::Static,
:urls => ["/style"],
:root => "public"
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('public/index.html', File::RDONLY)
]
}
没有一个答案在这里为我工作,我早就放弃了这个。 – David 2012-10-29 16:59:07
我有完全相同的问题...仍然没有解决方案? – dinkelk 2013-01-08 21:33:17