URL Rewriter Expression

96 Views Asked by At

My current rewriter working well but when a user comment on facebook and facebook append an URL on it, it can not load anymore.

This is my expression:

<rewrite url="~/hinh-anh/(.+)-(.+)" to="~/Content.aspx?ContentID=$2"/>

This is working well:

http://www.funbook.vn/hinh-anh/pho-cu-reu-phong-205

This URL doesn't work:

http://www.funbook.vn/hinh-anh/pho-cu-reu-phong-205?fb_comment_id=fbc_10151011439516616_22968658_10151011472976616#f17f94926c

Please help me, I am noob at regular expression.

Thank in advance!!

Edited:

Finally I found solution:

<rewrite url="~/hinh-anh/([A-Za-z\-]*)([\d]+)" to="~/Content.aspx?ContentID=$2"/>
2

There are 2 best solutions below

0
On

Finally I found solution:

`<rewrite url="~/hinh-anh/([A-Za-z\-]*)([\d]+)" to="~/Content.aspx?ContentID=$2"/>`
0
On

Try this one:

<rewrite url="~/hinh-anh/(.+)-(.+).*" to="~/Content.aspx?ContentID=$2"/>