开发者

why tuckey UrlRewriteFilter outbound-rule mapping did not work?

I'm using urlrewritefilter to pretty up my product links for a better google indexing (removing product parameter).

example:

.../product/snowboarda

i开发者_开发技巧s transferred via url rewriting rule to

.../product.seam?product=snowboarda

rewriting rule

<rule>
   <from>^/product/([a-zA-Z]+)$</from>
  <to>/product.seam?product=$1</to>
</rule>

But my problem is that I've no idea at the moment how to rewrite outbound links in my facelets. I read the paragraph about outbound-rule in the in the manual. Now I'm wondering how I can use this together with s:link? what about form submits or redirects (action outcome null)? please help to sort things out :)

possible rewriting outbound rule (?)

<outbound-rule>
 <from>^/product.seam?product=([a-zA-Z]+)$</from>
 <to>/product/$1</to>
</outbound-rule>

any hints/ideas?


I had the same problem and solved by escaping the ? character. It's a special regex character so you have to escape it with a \.


I had the same problem and solved it removing the caret at the beginning

<outbound-rule>
   <from>/product.seam?product=([a-zA-Z]+)$</from>
   <to>/product/$1</to>
</outbound-rule>

(Also, I'm not sure if you should try escaping the question mark symbol with \?)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜