āļ§āļīāļāļĩāļāļģāļāļēāļĢāļāļąāđāļāļāđāļēāđāļŦāđ IIS āļāļģāļāļēāļĢ Redirect HTTP to HTTPS āđāļāđāļāļąāļāļāļĩāđ
------------------------------------------------
āļŠāļģāļŦāļĢāļąāļāļāđāļēāļāđāļāđāļĄāđāļĄāļĩāđāļĄāļāļđ URL Rewrite āļŠāļēāļĄāļēāļĢāļāļāļēāļ§āđāđāļŦāļĨāļāļŠāđāļ§āļāđāļŠāļĢāļīāļĄāđāļāđāļāļĩāđāļāļĩāđ
https://www.iis.net/downloads/microsoft/url-rewrite
āļŦāļĢāļ·āļāļāļĨāļīāļāļāļĩāđāļāļĩāđāđāļāļ·āđāļāļāļēāļ§āđāđāļŦāļĨāļāļāļąāļāļāļĩ
- English: Web Platform Installer (WebPI) / [ āđāļ§āļāļĢāđāļāļąāđāļ 32 bit - x86 installer ] / [ āđāļ§āļāļĢāđāļāļąāđāļ 64 bit - x64 installer (āđāļāļ°āļāļģ) ]
------------------------------------------------
1. āļāļģāļāļēāļĢāđāļāļīāļāļŦāļāđāļēāļāļ IIS Manager āļāļĨāļīāļ URL Rewrite
Start > Run >Â inetmgr
āļŦāļĢāļ·āļ windows + R
2. āļāļ Add Rule(s) > āļāļĨāļīāļ Blank rule > āļāļ OK
3. āļāļģāļāļēāļĢāļāļąāđāļāļāļ·āđāļ http to https āđāļĨāļ° āļāļąāđāļāļāđāļēÂ Match URL Pattern āļāļąāļāļāļĩāđ
- āđāļĨāļ·āļāļ Request URL =Â Matches the Pattern
- āđāļĨāļ·āļāļ Using =Â Â Regular ExpressionsÂ
- āļāļĢāļāļāļāđāļāļ Pattern =Â (.*)
- āļāļīāđāļāļāļđāļāļāđāļāļÂ Ignore case
4. āļāļ āđāļŠāļāļ āđāļĨāļ° āļŠāļĢāđāļēāļ Conditions āđāļāļĒāđāļāļīāđāļĄāļāđāļāļĄāļđāļĨāļāļąāļāļāļąāļ§āļāļĒāđāļēāļ
- āļāļāļāļļāđāļĄ Add
- Condition input : {HTTPS}
- āļāļąāđāļāļāđāļē Check if input string:Â Matches the Pattern
- Pattern: ^OFF$
- āļāļīāđāļ Ignore case.
- āļāļāļāļļāđāļÂ OK
5. āđāļāļŠāđāļ§āļāļāļāļ Action āļāļąāđāļāļāđāļē Redirect āļāļąāļāļāļĩāđ
- Action Type : Redirect
- Redirect URL:Â https://{HTTP_HOST}{REQUEST_URI}
- āļāļ Apply āļāđāļēāļāļāļ§āļē āđāļāļ·āđāļāļāļąāļāļāļķāļāļāđāļē
āđāļĄāļ·āđāļāļāđāļēāļāđāļāđāļēāđāļ§āđāļāđāļāļāđāļāđāļ§āļĒ http āļĢāļ°āļāļāļāļ°āļāļģāļāļēāļĢ Redirect URL āļāļāļāļāđāļēāļāđāļāļĒāļąāļ HTTPS:// āđāļāļĒāļāļąāļāđāļāļĄāļąāļāļī
- 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.
- 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.
- See Other (303) â specific redirect type for GET requests. Not recommended for HTTP/HTTPS.
- Temporary (307) â HTTP/1.1 successor of 302 redirect type. Not recommended for HTTP/HTTPS.
OPTION 2: Specify the Redirect Rule as https://{HTTP_HOST}/{R:1} and check the Append query string box. The Action type is also to be set as Redirect.
 The rule is created in IIS, but the site is still not redirected to https://
āļ§āļīāļāļĩāļāļēāļĢāđāļāđāđāļÂ config āļāļāļ IIS āļāđāļ§āļĒāļāļāđāļāļ
The rule is created in IIS, but the site is still not redirected to https://
Normally, the redirection rule gets written into the web.config file located in the document root directory of your website. If the redirection does not work for some reason, make sure that web.config exists and check if it contains the appropriate rule.
To do this, follow these steps:
- In the sites list of IIS, right-click on your site. Choose the Explore option:
- Explore will open the document root directory of the site. Check if the web.config file is there.
- The web.config file must have the following code block:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="ensurewww" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{CACHE_URL}" pattern="^(.+)://(?!www)(.*)" /> </conditions> <action type="Redirect" url="{C:1}://www.{C:2}" redirectType="Permanent" /> </rule> <rule name="HTTPS Redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
Â
- If the web.config file is missing, you can create a new .txt file, put the aforementioned code there, save and then rename the file to web.config.
Reference :Â
https://www.ssl.com/how-to/redirect-http-to-https-with-windows-iis-10/
Â
āļŠāļģāļŦāļĢāļąāļāļāļēāļĢāļŠāļāļąāļāļŠāļāļļāļ āđāļĨāļ°āļāđāļ§āļĒāđāļŦāļĨāļ·āļ
http://www.ireallyhost.com/support
** āļāļāļāļ§āļēāļĄāļāļĩāđāļĄāļĩāļĨāļīāļāļŠāļīāļāļāļīāđ āđāļĄāđāļāļāļļāļāļēāļāļīāđāļŦāđāļāļąāļāļĨāļāļ āļāļģāļāđāļģ āļāļąāļāđāļāļĨāļāļāđāļāļāđāļāđāļĢāļąāļāļāļāļļāļāļēāļ **
āđāļāļĢāļāļĢāļ°āļāļļāđāļŦāļĨāđāļāļāļĩāđāļĄāļē āļāļĢāļīāļĐāļąāļ āđāļāđāļāļāđāļāļĢāđāļē āļāļāļĢāđāļāļāđāļĢāļāļąāđāļ āļāļģāļāļąāļ / https://www.ireallyhost.com