我有一个设置IIS URLRewrite条件的问题,以便在输入的url无效时将它带到设置的url。例如,你输入url:example.local/current_work这将是一个有效的网址,所以它显示的网页,但是为url:example.local/this_doesnt_exist它会重新引导你回到example.local/current_work等...如何在IIS中设置条件UrlRewrite以检查URL是否有效
希望我明白这一点。
<rewrite>
<rules>
<rule name="Test" stopProcessing="true">
<match url="^scottishtrunkroadsse.amey.local/([_0-9a-z-]+)" negate="false"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="current-works/" />
</rule>
</rules>
<rewrite>
谢谢你的帮助。
我正在使用Umbraco网站,但我不认为改变任何东西,因为IIS网址应该以相同的方式工作。
预先感谢您。
你想创建重定向'example.local/this_doesnt_exist'为'example.local/current_work'。只为这个网址?或者你有没有不存在的网址列表? –
只为这个网址,谢谢 –