App Muncher

Issues faced - solutions identified - shared with community.

Enabled SSL on a site.

Post enabling SSL, the site was still accessible via http requests.

In order to redirect all http request to https requests, installed URL Rewrite module.

It can be downloaded via link IIS URL REWRITE

Once installed, you can access it via the IIS interface, "URL Rewrite"



Open URL Rewrite, and click ADD RULE.

Add the rule as follows - 


Select Blank Rule and click OK.

In Match URL, enter pattern as (.*)

In Conditions, click Add and create a HTTPS condition, enter the pattern as ^OFF$.



As we want to redirect the http requests to https, select Action --> Action Type as Redirect.

Redirect URL - Pass the FQDN

Redirect Type - Select Permanent(301).


There are 4 types of redirects - 


  1. Permanent (301) – preferable type in this case, which tells clients that the content of the site is permanently moved to the HTTPS version. Good for SEO, as it brings all the traffic to your HTTPS website making a positive effect on its ranking in search engines.
  2. Found (302) – should be used only if you moved the content of certain pages to a new place *temporarily*. This way the SEO traffic goes in favour of the previous content’s location. This option is generally not recommended for a HTTP/HTTPS redirect.
  3. See Other (303) – specific redirect type for GET requests. Not recommended for HTTP/HTTPS.
  4. Temporary (307) – HTTP/1.1 successor of 302 redirect type. Not recommended for HTTP/HTTPS.


The added rule can also be verified in the web.config

Following code snippet describes the example above

<configuration> <system .webserver=""> <rewrite> <rules> <rule enabled="true" name="HTTPS force" stopprocessing="true"> <match url="(.*)"> <conditions> <add input="{HTTPS}" pattern="^OFF$"> </add></conditions> <action redirecttype="Permanent" type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}"> </action></match></rule> </rules> </rewrite> </system> </configuration>

2 comments:

  1. Merkur 2-Tint 2-Tint 2-Tint 2-Tint 2-Tint 2-Tint 2-Tint 3 - Titanium Art
    Shop Merkur 2-Tint 2-Tint 2-Tint 2-Tint 2-Tint 2-Tint 2-Tint 2-Tint 2-Tint 3-Tint 3-Tint gaggia titanium 3-Tint black titanium fallout 76 3-Tint 3-Tint edge titanium 3-Tint 3-Tint chi titanium flat iron 3-Tint 3-Tint 3-Tint microtouch titanium trim 3-Tint

    ReplyDelete

| Designed by AppMuncher