HTTP to HTTPS redirect is not working

amjadmapari
amjadmapari used Ask the Experts™
on
Hi,

I am trying to redirect a IIS 8.0 URL from HTTP to HTTPS. Have installed URL redirect and followed below articles.
But still getting error. Can you please help.

https://www.youtube.com/watch?v=U7USHit5mhY
http://stackoverflow.com/questions/19233094/the-http-request-is-unauthorized-with-client-authentication-scheme-anonymous
HTTP-Redirect-error.jpg
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Use this for your web.config file.  Create a file in the directory that you want to be HTTPS and name the file "web.config" and add it to the directory.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed"/>
  <rewrite>
    <rules>
      <rule name="Redirect to HTTPS" stopProcessing="true">
        <match url=".*" />

        <conditions>
          <add input="{HTTP_CLUSTER_HTTPS}" pattern="^on$" negate="true" />
          <add input="{HTTP_CLUSTER_HTTPS}" pattern=".+" negate="true" />

        </conditions>
        <action type="Redirect" url="https://{HTTP_HOST}{SCRIPT_NAME}" redirectType="SeeOther" />
      </rule>

    </rules>
  </rewrite>
</system.webServer>
</configuration>

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial