我想从重定向example.com/folder
到example.com/file.php?url=folder
通过web.config
。
我该怎么做?
根据您的描述,我建议您首先安装url重写扩展名。网址:https://www.iis.net/downloads/microsoft/url-rewrite
然后,您可以使用以下url重写规则到web.config中以实现您的要求。
<rewrite>
<rules>
<rule name="Addquerystring" stopProcessing="true">
<match url=".*" />
<action type="Redirect" url="http://example.com/file.php?url={R:0}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句