为什么我需要手动输入HTTPS才能访问我的网站? [英] Why i need to type HTTPS manually to access my site?

查看:1289
本文介绍了为什么我需要手动输入HTTPS才能访问我的网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么每次在浏览器中都需要在网站URL之前键入 https ?我的网站已启用 SSL ,它将转到默认的IIS页面.请帮助我.

我在浏览器中输入的URL-fdrms.visiontek.co.in/

如果每次我想查看启用SSL的页面时,都需要在上述URL之前添加 https://,例如-

  • 打开IIS管理器窗口,然后从连接窗格中选择要应用重定向规则的站点.

  • 功能视图中选择 URL重写.
  • 在重写模块的操作窗格中单击添加规则.
  • 入站部分中选择空白规则,然后按OK.
  • 输入规则名称.
  • 在匹配网址"部分:

  • 在请求的URL"下拉菜单中选择匹配模式"

  • 在使用"下拉菜单中选择正则表达式"
  • 在匹配URL"部分中输入以下格式:(.*)"
  • 选中忽略大小写"框
  • 在条件"部分的逻辑分组"下拉菜单下,选择全部匹配",然后在提示窗口中按添加":
  • 输入"{HTTPS}"作为条件输入
  • 从下拉菜单中选择匹配样式"
  • 输入"off"作为模式
  • -按确定"-在操作"部分中,选择重定向"作为操作类型,然后为重定向URL"指定以下内容:https://{HTTP_HOST} {REQUEST_URI}-选中附加查询字符串"框.-选择重定向类型.-点击操作"菜单右侧的应用".

    您也可以使用上述UI模块直接在web.config文件中添加此规则.

     < configuration>< system.webServer>< rewrite><规则><规则名称="HTTP到HTTPS的HTTP"已启用="true" stopProcessing ="true">< match url =(.*)"/><条件><添加input ="{HTTPS}" pattern ="off"/></conditions>< action type ="Redirect" url ="https://{HTTP_HOST} {REQUEST_URI}" redirectType ="Permanent"/></rule></rules></rewrite></system.webServer></configuration> 

    关于,贾尔帕.

    why do I need to type https before my site URL every time in the browser? Tho my website has SSL enabled it's going to default IIS page. Please help me with this.

    This url i'm typing in browser -- fdrms.visiontek.co.in/

    If I want to see my SSL enabled page every time I need to add https:// before above URL like -- https://fdrms.visiontek.co.in/

    解决方案

    Once the SSL certificate is installed, your site still remains accessible via a regular insecure HTTP connection. To connect secure url you need to manually enter https:// prefix. To force a secure connection on your website you need to set redirect rule which redirects http to https.

    You could follow below steps to redirect site from http to https:

    • Download Url rewrite module manually or from web platform installer.https://www.iis.net/downloads/microsoft/url-rewrite

    • Open IIS manager window and select site from connection pane which you want to apply redirect rule.

    • Select URL Rewrite from feature view.
    • Click Add Rule from Action pane in a rewrite module.
    • Select Blank Rule in the Inbound section, then press OK.
    • Enter the rule name.
    • In the "Match URL" section:

    • Select "Matches the Pattern" in the "Requested URL" drop-down menu

    • Select "Regular Expressions" in the "Using" drop-down menu
    • Enter the following pattern in the "Match URL" section: "(.*)"
    • Check the "Ignore case" box
    • In the "Conditions" section, select "Match all" under the "Logical Grouping" drop-down menu and press "Add" In the prompted window:
    • Enter "{HTTPS}" as a condition input
    • Select "Matches the Pattern" from the drop-down menu
    • Enter "off" as a pattern

    - Press "OK" - In the "Action" section, select "Redirect" as the action type and specify the following for "Redirect URL": https://{HTTP_HOST}{REQUEST_URI} - Check the "Append query string" box. - Select the Redirection Type. - Click on "Apply" on the right side of the "Actions" menu.

    You could also add this rule directly in web.config file withoud using UI module which mention above.

     <configuration>
     <system.webServer>
     <rewrite>
     <rules>
     <rule name="HTTP to HTTPS" enabled="true" stopProcessing="true">
     <match url="(.*)" />
     <conditions>
     <add input="{HTTPS}" pattern="off" />
     </conditions>
     <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
     </rule>
     </rules>
     </rewrite>
     </system.webServer>
    </configuration>
    

    Regards, Jalpa.

    这篇关于为什么我需要手动输入HTTPS才能访问我的网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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