z-blog博客ssl和静态化设置同时配置web.config
z-blog博客程序还是挺简单的,毕竟好用,很好上手,我其实也是刚用几天而已,遇到些问题,都解决了,本来之前配置了ssl代码的,但是静态化模块里面设置的时候生成了就自动覆盖了web.config文件,里面再也没有ssl配置代码了。
如果要加进去就得手动加,但是从新把两个代码加到一起网站就会出现错误,要么只能实现ssl用https访问,要么就只能静态化。
需要的可以参考,跟我一样的应该有很多直接复制就可以用
z-blog博客ssl和静态化设置同时配置web.config代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="301" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" ></match>
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_FROM_HTTPS}" pattern="^on$" negate="true" ></add>
</conditions>
<action type="Redirect" url="https://ydy56.cn/{R:1}" redirectType="Permanent" ></action>
</rule>
<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>