我一直在研究一个小链接长度supressor网站,似乎无法在IIS7上找到它。我习惯于在isapi rewrite和mod_rewrite上工作。IIS7 URL重写短url
以下情形是活动的:
可以说我有test.com,那是主要的域名。域应该正常处理所有文件。但是当/.*
不是目录也不是文件时,它应该将其发送到redirect.asp?text=(.*)
。
这是我的web.config看起来像
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="YOURLS 1" stopProcessing="true">
<match url="^([0-9A-Za-z-]+)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="redirect.asp?test={R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
不,它不是。似乎是URL重写器的问题。我有1.5安装,它没有工作。我已经使用webinstaller升级到2.0,它似乎工作得很好!谢谢您的帮助。 –