我要将这个URL http://www.example.com/controlpanel/index.php重写为以下内容:http://www.example.com/
也就是说,我需要以某种方式摆脱“控制面板”部分,并迫使index.php解析为根。
我正在运行Win Server 2016和IIS 10.0。
谢谢
发布于 2017-07-12 11:21:15
你需要做的是:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="rewrite sample" stopProcessing="true">
<match url="^$" />
<action type="Rewrite" url="/controlpanel/index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>如果您已经拥有web.config文件,只需添加我的rule
此规则将将主页http://www.example.com/重写为http://www.example.com/controlpanel/index.php。
https://stackoverflow.com/questions/45050479
复制相似问题