为什么我需要手动输入 HTTPS 才能访问我的网站?

Cha*_*kya 1 asp.net iis ssl-certificate

为什么我每次在浏览器中都需要在网站 URL 前输入https ?虽然我的网站启用了SSL,但它会转到默认的 IIS 页面。请在这件事上给予我帮助。

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

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

Jal*_*hal 6

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.

\n\n

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

\n\n
    \n
  • Download Url rewrite module manually or from web platform installer.https://www.iis.net/downloads/microsoft/url-rewrite\n在此输入图像描述

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

  • \n
  • Select URL Rewrite from feature view.\n在此输入图像描述
  • \n
  • Click Add Rule from Action pane in a rewrite module.
  • \n
  • Select Blank Rule in the Inbound section, then press OK.\n在此输入图像描述
  • \n
  • Enter the rule name.
  • \n
  • In the \xe2\x80\x9cMatch URL\xe2\x80\x9d section:

  • \n
  • Select \xe2\x80\x9cMatches the Pattern\xe2\x80\x9d in the \xe2\x80\x9cRequested URL\xe2\x80\x9d drop-down menu

  • \n
  • Select \xe2\x80\x9cRegular Expressions\xe2\x80\x9d in the \xe2\x80\x9cUsing\xe2\x80\x9d drop-down menu
  • \n
  • Enter the following pattern in the \xe2\x80\x9cMatch URL\xe2\x80\x9d section: \xe2\x80\x9c(.*)\xe2\x80\x9d
  • \n
  • Check the \xe2\x80\x9cIgnore case\xe2\x80\x9d box
  • \n
  • In the \xe2\x80\x9cConditions\xe2\x80\x9d section, select \xe2\x80\x9cMatch all\xe2\x80\x9d under the \xe2\x80\x9cLogical Grouping\xe2\x80\x9d drop-down menu and press \xe2\x80\x9cAdd\xe2\x80\x9d In the prompted window:
  • \n
  • Enter \xe2\x80\x9c{HTTPS}\xe2\x80\x9d as a condition input
  • \n
  • Select \xe2\x80\x9cMatches the Pattern\xe2\x80\x9d from the drop-down menu
  • \n
  • Enter \xe2\x80\x9coff\xe2\x80\x9d as a pattern
  • \n
\n\n

在此输入图像描述\n - Press \xe2\x80\x9cOK\xe2\x80\x9d \n - In the \xe2\x80\x9cAction\xe2\x80\x9d section, select \xe2\x80\x9cRedirect\xe2\x80\x9d as the action type and specify the following for \xe2\x80\x9cRedirect URL\xe2\x80\x9d: https://{HTTP_HOST}{REQUEST_URI}\n - Check the \xe2\x80\x9cAppend query string\xe2\x80\x9d box.\n - Select the Redirection Type. \n - Click on \xe2\x80\x9cApply\xe2\x80\x9d on the right side of the \xe2\x80\x9cActions\xe2\x80\x9d menu.\n在此输入图像描述

\n\n

您还可以直接在 web.config 文件中添加此规则,而不使用上面提到的 UI 模块。

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

此致,\n贾尔帕。

\n