Windows IIS 虚拟机主机 web.confg ,配置文件里只有php调用版本的内容,手动加配置 http跳转https,zblog伪静态,具体样例如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<!-- 虚拟机默认调用php版本配置 -->
<remove name="PHP5.2" />
<add name="php-7.3" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\PHP\7.3\php-cgi.exe" resourceType="Either" />
</handlers>
<rewrite>
<rules>
<!-- 强制 HTTP 跳转 HTTPS -->
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
<!-- Z-BlogPHP 伪静态规则 -->
<rule name="/ Z-BlogPHP Imported Rule" stopProcessing="true">
<match url="^.*?" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
<rule name="/ Z-BlogPHP Imported Rule index.php" stopProcessing="true">
<match url="^index.php/.*?" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/9127.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~