开发者

Url rewriting affects other linksthe

Am using url reqritting with following rule :

<rule source="(.)/galary.aspx" destination="galary.aspx?$1"/>

The links are in MasterPage where I have set achor tags like :

<a href="/2/galary.aspx">Galary 2</a>

Which internally deals as :

/galary.aspx?2

The page is working开发者_StackOverflow fine for me with this rule. But the other link breaks and the images are not shown on pages like.

When checked the source code of the page, I found that the links of all images and other Menus are changed in the same format as, I applied rules for the url. Like : actual images path: /images/img.gif but now these are : /2/images/img.gif

I manually set the absolute path for everything then images appeared but its not a solution.

Waiting for your inputs


Your solution is simple, your rule match every links because of dot (.). change rule you need a regular expression that match with number first:

(\d+)/gallery\.aspx

replace your rule with this and it only match with Number/Gallery.aspx

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜