我正在将一个网站更新为一个更动态的版本。在新站点中,我使用散列标签,而不是对内容的每个更改都使用新页面。
我在目录中使用web.config文件来重定向,但它添加了一个反斜杠。有什么办法可以避免这种情况吗?我已经在重定向中处理它了,但我觉得它有点笨拙。
下面是一个web.config示例
<?xml version="1.0"?>
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="/legal/#!terms-of-use" />
</system.webServer>
</configuration>
编辑:值得一提的是,它不是转到"/legal/#!terms- of -use“,而是转到"/legal/#!terms-of-use/”,注意末尾的反斜杠。
发布于 2013-06-11 22:07:55
在重定向元素中启用exactDestination,如下所示:
<httpRedirect enabled="true" destination="/legal/#!terms-of-use" exactDestination="true" />
https://stackoverflow.com/questions/17045626
复制相似问题