我是Tuckey的URLRewriteFilter的新手,所以我正在尝试这个事情。
在我的项目中,我收到了类似的URL index.cfm?action=management.start.home
。我想将这些内容重写为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
,一切按预期进行。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句