网址rewritting影响其他linksthe [英] Url rewritting affects other linksthe

查看:83
本文介绍了网址rewritting影响其他linksthe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的URL与以下规则reqritting:

Am using url reqritting with following rule :

<治源=/ galary.aspx()目标=galary.aspx $ 1吗?/>

<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&GT; Galary 2'; / A&GT;结果
  它在内部交易为:结果
  /galary.aspx?2

<a href="/2/galary.aspx">Galary 2</a>
Which internally deals as :
/galary.aspx?2

该页面工作正常,我用此规则。但是其他环节的休息时间和图像不喜欢上显示的页面

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

在检查了页面的源代码code,我发现所有图像和其它菜单的链接相同的格式被改变,我申请规则的URL。
这样的:实际图像路径:/images/img.gif但现在它们是:/2/images/img.gif

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.

等待你输入

推荐答案

您的解决方案很简单,因为点的的各个环节的规​​则匹配(。)。变化规律需要先用数字匹配常规的前pression:

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

这个替换您的规则,它只是相匹配的输入/ Gallery.aspx

这篇关于网址rewritting影响其他linksthe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆