幫助中心
這里有最新的使用文檔和教程
Windows寶塔,Asp/Aspx程序如何設置偽靜態/重定向等功能
說明: Asp/Aspx程序一般都有默認的一套配置文件,所以面板暫不支持自動配置偽靜態功能,需要自己手動配置。 web.config路徑在網站(站點)根目錄下 如何手動配置? 分為兩種情況,情況如下: 1、當Asp程序根目錄不存在web.config文件,或者配置文件內容為如下代碼時: 可以直接將面板生成的代碼復制到偽靜態,保存即可
|
3、(重要)當Asp網站不存在原有配置文件時,將網站目錄下的web.config文件內容替換成以下代碼即可
- <?xml version="1.0" ?>
- <configuration>
- <location path="." allowOverride="false" inheritInChildApplications="false">
- <system.webServer>
- <rewrite>
- <rules>
- <rule name="http_toHttps" stopProcessing="true">
- <match url="(.*)"/>
- <conditions>
- <add input="{HTTPS}" pattern="off" ignoreCase="true"/>
- </conditions>
- <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}"/>
- </rule>
- </rules>
- </rewrite>
- </system.webServer>
- </location>
- </configuration>
手動修改后的代碼:
注意1:如果【圖1】中存在<system.webServer>/<rewrite>/<rules>,則直接加入在下級節點
注意2:如果【圖1】中不存在<system.webServer>/<rewrite>/<rules>,則需要手動添加,下圖為手動添加【<system.webServer>/<rewrite>/<rules>】