Security SSL,如何将到网站的链接转发到包含SSL的版本?

Security SSL,如何将到网站的链接转发到包含SSL的版本?,security,ssl,web-config,websecurity,Security,Ssl,Web Config,Websecurity,我有一个关于SSL的小问题。我有一个网站,我们已经购买了SSL,并在web.config中制定了一些重写规则。但问题是,有时我们无法重定向到https版本。当我们使用https键入域时,它可以完美地工作,但当我们删除https时,我们无法重定向到站点的安全版本。这是我们的web.config文件(为了隐私,我将我们的网站名挂为example.com) 我们还能做些什么来确保每次我们都会重新编辑链接的安全版本(https)?您是否使用了这些Apache、IIS、Tomcat和Nginx中的一种

我有一个关于SSL的小问题。我有一个网站,我们已经购买了SSL,并在web.config中制定了一些重写规则。但问题是,有时我们无法重定向到https版本。当我们使用https键入域时,它可以完美地工作,但当我们删除https时,我们无法重定向到站点的安全版本。这是我们的web.config文件(为了隐私,我将我们的网站名挂为example.com)



我们还能做些什么来确保每次我们都会重新编辑链接的安全版本(https)?

您是否使用了这些Apache、IIS、Tomcat和Nginx中的一种?您必须设置让http重定向到https。

thx以获得答案。我们正在使用IIS。但是我们如何从https重定向到https?请尝试复制以下内容:
 <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
                <rule name="Redirect to www" enabled="false" stopProcessing="true">
                      <match url="(.*)" />
                      <conditions trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="^example.COM$" />
                      </conditions>
                      <action type="Redirect" url="{MapProtocol:{HTTPS}}://www.example.com/{R:1}" />
                 </rule>
            <rule name="AngularJS Routes" enabled="true" stopProcessing="true">
              <match url=".*" />
              <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />   
              </conditions>
              <action type="Rewrite" url="/" logRewrittenUrl="false" />
            </rule>
                <rule name="Redirect HTTP to HTTPS" enabled="false" stopProcessing="true">
                     <match url="(.*)" />
                     <conditions>
                     <add input="{HTTPS}" pattern="^OFF$" />
                     </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{HTTP_URL}" appendQueryString="false" redirectType="SeeOther" />
               </rule>

                      <rule name="Force non-WWW and SSL" enabled="true" stopProcessing="true">
                          <match url="(.*)" negate="true" />
                          <conditions logicalGrouping="MatchAny">
                        <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
                        <add input="{HTTPS}" pattern="off" />
                          </conditions>
                          <action type="Redirect" url="https://example.com/{R:0}" appendQueryString="true" redirectType="Permanent" />
                     </rule>

          </rules>
        </rewrite>
      </system.webServer>
    </configuration>