欢迎光临
我们一直在努力

iis环境下http访问自动跳转https地址的伪静态写法

http访问自动跳转https的具体代码如下(前提安装重新规则):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 <system.webServer>
   <rewrite>
            <rules>
                <rule name="https" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                        <add input="{HTTPS_HOST}" pattern="^(localhost)" negate="true" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
                </rule>
 <rule name="OrgPage" stopProcessing="true">
					<match url="^(.*)$" />
					<conditions logicalGrouping="MatchAll">
						<add input="{HTTP_HOST}" pattern="^(.*)$" />
						<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
						<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
					</conditions>
					<action type="Rewrite" url="index.php/{R:1}" />
				</rule>

            </rules>
        </rewrite>
        <defaultDocument enabled="true">
            <files>
                <clear />
                <add value="index.php" />
            </files>
        </defaultDocument>
 </system.webServer>
</configuration>
赞(0) 打赏
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 ivillcn@qq.com 举报,一经查实,本站将立刻删除。
文章名称:《iis环境下http访问自动跳转https地址的伪静态写法》
文章链接:https://www.bilibiji.com/article/256.html

评论 抢沙发

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

微信扫一扫

登录

找回密码

注册