CFWheels网站根目录的不同重写模式
我需要关于研究以下问题的建议。
Wheels 网站已配置 set(URLRewriting="On")
,除了根页面外,一切看起来都很好。
所有使用 linkTo
构建的链接都类似于 website.tld/controller/action
。
但在 / 模式下“切换”到部分,链接看起来像 website.tld/index.cfm/controller/action
。有趣的是,如果显式访问默认路由页面(在本例中为/pages/index)——URL 构建正确。
网站在 Ubuntu 下的 Tomcat 和 Apache2 中运行,直接在虚拟主机配置中配置标准 Wheels 重写规则,作为 .htaccess 已知问题的解决方法。
从哪里开始?要检查哪些变量以及如何调试?
谢谢。
UPD 目前我能看到的是,当直接访问默认操作时,调试输出中没有 Route: home
。不知道如何使用此信息,我对车轮的经验非常少。
I need an advice on researching the following issue.
Wheels website has set(URLRewriting="On")
configured, everything looks fine except root page.
All links built with linkTo
look like website.tld/controller/action
.
But on a / mode "switched" into the partial and links look like website.tld/index.cfm/controller/action
. Interestingly, if default route page accessed explicitly (/pages/index in this case) -- URLs built properly.
Website is running in Tomcat with Apache2 under Ubuntu, standard Wheels rewriting rules configured directly in a vhost config, as a workaround to known issue with .htaccess.
Where to start? What variables to check and how to debug this?
Thanks.
UPD All I can see for now is that when default action accessed directly there's no Route: home
in the debug output. Not sure how to use this info, I have very small experience with Wheels.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有一个非常相似的设置,刚才遇到了同样的问题。作为临时解决方法,我发现通过将wheels/global/public.cfm 的第294 行更改为
linkTo
() 构建了一个可用于URL 重写的路径。我会联系一些更熟悉 Wheels 的朋友,看看是否需要补丁来修复这个问题。
I have a very similar setup and ran into the same problem just now. As a temporary workaround I found that by changing line 294 of wheels/global/public.cfm from
to
that linkTo() built a path that worked with URL rewriting. I'll ping some friends more familiar with Wheels to see if there's a patch required to fix this.
由于 Chris Peters 没有创建答案,因此我将这样做只是为了将问题标记为已解决。无论如何,一切荣耀归于克里斯。
如果您不重写到 rewrite.cfm,通常 Wheels 会忽略 set(urlRewriting="On")。确保请求通过 rewrite.cfm 而不是 index.cfm 进行路由
这意味着您需要检查有问题的页面上的 CGI 范围并修复重写解决方法规则(很少有我认为其中有 Tomcat+CFWheels)。
Since Chris Peters did not create the answer, I'll do this instead just to mark the question resolved. All glory to Chris, any way.
Usually Wheels will ignore set(urlRewriting="On") if you're not rewriting to rewrite.cfm. Make sure that requests are routing through rewrite.cfm and not index.cfm
It means that you need to check the CGI scope on the problematic pages and fix the rewriting workaround rules (there are few of them for Tomcat+CFWheels, I think).