乘客无法使用 .htaccess 文件中的重写规则吗?
我有一个重写规则,仅在虚拟主机上下文中有效。
PassengerEnabled on RewriteEngine on RewriteRule ^/release-.+/(images|javascripts|stylesheets|system|assets)/(.*)$ /$1/$2 [L]
如果我在 .htaccess 文件中设置 PassengerEnabled off
,则重写规则可以正常工作,否则它们只能在
站点配置中工作。
有没有办法让重写规则在 .htaccess 文件中与乘客一起使用?
I have a rewrite rule that only works when in a virtualhost context.
PassengerEnabled on RewriteEngine on RewriteRule ^/release-.+/(images|javascripts|stylesheets|system|assets)/(.*)$ /$1/$2 [L]
If I set PassengerEnabled off
in the .htaccess file, the rewrite rules work fine, otherwise they only work in the <VirtualHost>
site config.
Is there a way to have rewrite rules be used in the .htaccess file with passenger?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,Passenger 应与 mod_rewrite 兼容,只要 PassengerHighPerformance 是离开。
如果您使用的是旧版本的 Phusion Passenger,您可能需要确保 RailsAllowModRewrite 设置正确。
Passenger should be compatible with mod_rewrite by default as long as PassengerHighPerformance is off.
If you're using an older version of Phusion Passenger you might want to make sure RailsAllowModRewrite is set correctly.