如何使用web.config [IIS]缩短URL GET数据

时间:2014-07-27 08:20:46

标签: php iis

我试过环顾四周,但似乎无法找到我的查询中的单词。我自己没有足够的知识来做这件事,但基本上我想缩短这个网址:

http://example.com/register/?ref=Liam

http://example.com/register/ref/Liam

使用IIS web.config。

1 个答案:

答案 0 :(得分:0)

你可以使用这个web.config:

<rule name="rule 1N" stopProcessing="true">
     <match url="^register/(.+)/(.*)$"  />
     <action type="Rewrite" url="/register/?{R:1}={R:2}"  />
</rule>

现在,如果您打开example.com/register/ref/r,您会看到example.com/register?ref=r