HTTP到https重定向不起作用 [英] HTTP to https redirection is not working

查看:670
本文介绍了HTTP到https重定向不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我正在尝试将我的网站从http重定向到Azure服务器(云服务)的https。我在web cofig中添加了重定向规则,但它无法正常工作。我正在cloudservice中将http扩展为http到https,它不在那里。你能否建议
我该怎么做?



我在网页配置中添加了以下内容:


 < rewrite>

  &NBSP; &NBSP; &NBSP; < rules>

  &NBSP; &NBSP; &NBSP; &NBSP; < rule name ="重定向到HTTPS">

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < match url ="(。*)" />

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < conditions>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < add input =" {HTTPS}"图案= QUOT;脱" IGNORECASE = QUOT;真" />

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < add input =" {URL}"图案= QUOT; / $"否定= QUOT;真" />

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < add input =" {REQUEST_FILENAME}"使用MatchType = QUOT; ISFILE"否定= QUOT;真" />

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / conditions>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < action type =" Redirect" URL =" HTTPS:// {SERVER_NAME} / {R 1}" redirectType = QUOT; SeeOther" />

  &NBSP; &NBSP; &NBSP; &NBSP; < / rule>

  &NBSP; &NBSP; &NBSP; < / rules>

  &NBSP; &NBSP; < / rewrite>


我是否可以从azure portal处理它 


解决方案

您是否在我们拥有的云服务中检查了以下有关配置SSL的信息? 


https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-configure -ssl证书的门户


 I am trying to redirect my site from http to https at azure server (cloud service). I have added redirect rule in web cofig but its not working. I was seaching the extension for http to https in cloudservice what its not there. Could you please suggest how can I do this

I have added following in web config :

 <rewrite>
        <rules>
          <rule name="Redirect to HTTPS">
            <match url="(.*)" />
            <conditions>
              <add input="{HTTPS}" pattern="off" ignoreCase="true" />
              <add input="{URL}" pattern="/$" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            </conditions>
            <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="SeeOther" />
          </rule>
        </rules>
      </rewrite>

Can I handle it from azure portal 

解决方案

Have you checked the following on configuring SSL in a cloud service we have? 

https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-configure-ssl-certificate-portal


这篇关于HTTP到https重定向不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆