我是Tuckey的URLRewriteFilter的新手,所以我正在尝试这个东西。
在我的项目中,我得到了像 index.cfm?action=management.start.home
这样的 URL。我想重写这些以management/start/home
.
所以我写了以下过滤器:
<rule>
<from>/management/start/home</from>
<to type="redirect">/index.cfm?action=management.start.home</to>
</rule>
它运行良好,因为显示了来自给定 url 的内容。但我偶然发现了一个问题。我所有指向静态源的链接也已更改。
所有链接都包含management/start/
件。例如:
public/js/company/jquery.company.button.js
management/start/public/js/company/jquery.company.button.js
我在手册中找不到修复它的信息...
它改变的原因是链接是动态的。所以我public/js/company/jquery.company.button.js
更改为/public/js/company/jquery.company.button.js
,一切都按预期工作。