如何在IIS中编写允许HTML锚点的重写规则? [英] How do write a rewrite rule in IIS that allows HTML anchors?
本文介绍了如何在IIS中编写允许HTML锚点的重写规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前我的规则似乎不起作用,我想知道我是否可以使用html锚点#
来重定向用户
Currently I have a rule that doesn't seem to work and I am wondering if I can use html anchors #
to redirect users
<match url="^article\/article\.aspx$" />
<action type="Redirect" url="http://www.abc.com" />
<conditions>
<add input="{QUERY_STRING}" pattern="#24" />
</conditions>
推荐答案
网址中的哈希标记用于特殊目的客户端浏览器,而不是服务器。这意味着浏览器实际上不会将#字符后的任何内容发送到服务器。所以:如果您要求 http://someurl.com/index.aspx#something
,服务器只能看到 http://someurl.com/ index.aspx
Hash Tags in the URL serve a special purpose to the client browser, not to the server. That means that a browser will NOT actually send anything after a '#' character to the server. So: if you request http://someurl.com/index.aspx#something
, the server only sees http://someurl.com/index.aspx
这篇关于如何在IIS中编写允许HTML锚点的重写规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文