内容简介:网站的程序是wordpress,运行的web服务器对于任何地址,如果不是 https 就跳转到伪静态就做了一点,就是文件不存在,就去执行'/index.php'
网站的程序是wordpress,运行的web服务器 IIS ,网站升级成了https, 需要在服务器中做两个设置。第一: 跳转设置,从 http 跳转到 https 。第二: 支持伪静态,这里简单粗暴的方式,设置的是如果文件不存在,就重写到 index.php ,然后执行wordpress。
完整的web.config 文件
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="HTTP to HTTPS redirect" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:0}" />
</rule>
<rule name="wordpress rewrite" enabled="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="/index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
http 跳转到 https 的设置
<rule name="HTTP to HTTPS redirect" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:0}" />
</rule>
对于任何地址,如果不是 https 就跳转到 https , {R:0} 表示url中域名之后的部分。
伪静态的支持
<rule name="wordpress rewrite" enabled="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="/index.php" />
</rule>
伪静态就做了一点,就是文件不存在,就去执行'/index.php'
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- golang gorilla/mux设置静态目录
- VMware中CentOS7静态ip的设置
- Spring Boot 设置项目名后静态文件相对路径问题
- golang 静态文件资源服务器设置2 Main.go代码<embed wmode="transparent" src="https://qq4668620...
- 静态库遇到静态库
- 全局变量,静态全局变量,局部变量,静态局部变量
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
CSS权威指南(第三版·英文影印版)
[美] Eric A.Meyer / 东南大学出版社 / 2007-06 / 68.00元
著名的CSS专家Eric A.Meyer他招牌式的智慧和无与伦比的经验引领读者探索了CSS的各个部 分,包括属性、标记、特性和实现。此外,他还就现实应用中的一些问题,例如浏览器的支持和设计方针,发表了看法。你所要知道的就是HTML 4.0的知识,这样就可以创建整洁、易于维护的脚本,以与桌面出版系统同样的优雅和控制能力管理网站布局和分页。你将会学到: 精妙地设计文本风格 用户界面、......一起来看看 《CSS权威指南(第三版·英文影印版)》 这本书的介绍吧!