Chanikya
Chanikya

Reputation: 486

Why i need to type HTTPS manually to access my site?

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/

Upvotes: 1

Views: 6187

Answers (2)

Rich-Lang
Rich-Lang

Reputation: 467

The behavior you are seeing is your browser's doing. When you type www.example.com, it translates that to http://www.example.com. How your WebServer is configured doesn't really affect what your browser does in this case. As others have mentioned, if you want, you can have your web server automatically redirect any requests to HTTP to HTTPS and thus use your SSL site.

URL Rewite is the best way to accomplish this, you can check out what the rule would looke like here: https://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/#redirect-https

Upvotes: 2

Jalpa Panchal
Jalpa Panchal

Reputation: 12759

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 enter image description here

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

  • Select URL Rewrite from feature view. enter image description here
  • Click Add Rule from Action pane in a rewrite module.
  • Select Blank Rule in the Inbound section, then press OK. enter image description here
  • 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

enter image description here - 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. enter image description here

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.

Upvotes: 6

Related Questions