当前位置: 首页 > Web技术 > 正文

IIS7将HTTPS重定向到HTTP

Mr.linus 发表于2019年10月28日 20:55

网上的教程大部分都是http重定向到https的,但是有些网站清退https的时候,百度收录的都是https的链接,现在就需要把https重定向回http。

.htaccess方式

RewriteCond %{SERVER_PORT} !^80$

RewriteCond %{HTTP_USER_AGENT} !MSIE/[1-8]\. [NC]

RewriteCond %{HTTP_HOST} xxx.com

RewriteRule ^.*$ http://xxx.com%{REQUEST_URI} [L,R=301]


IIS web.config方式

<rewrite>

            <rules>

                <rule name="https to http" enabled="true" stopProcessing="true">

                    <match url="(.*)" />

                    <conditions>

                        <add input="{HTTPS}" pattern="^ON$" />

                    </conditions>

            <action type="Redirect" url="http://{HTTP_HOST}/{R:1}" redirectType="Permanent" />

                </rule>

            </rules>

        </rewrite>


全文完
本文标签: 301重定向https重定向http44380443重定向到80
本文标题: IIS7将HTTPS重定向到HTTP
本文链接: http://www.90qj.com/m/?post=545

〓 随机文章推荐

共有4349阅 / 0我要评论
  1. 还没有评论呢,快抢沙发~

发表你的评论吧返回顶部

!评论内容需包含中文


请勾选本项再提交评论