[英]URL Rewrite - ISAPI
我將這個URL http://www.example.com/controlpanel/index.php重寫為以下內容: http : //www.example.com/
意思是,我需要以某種方式擺脫“ controlpanel”部分,並迫使index.php解析為root。
我正在運行Win Server 2016和IIS 10.0。
謝謝
你需要做什么:
<?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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.