Sachith H M
Sachith H M

Reputation: 1

HTTP to HTTPS redirect in IIS 8

https://testitnow.in/edgar is the website which is built on ASP. I configured auto redirect in IIS but still, if I type testitnow.in in the web browser I'm getting the following error - "403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied."

But if I type https://testitnow.in or www.testitnow.in it is redirecting to https://testitnow.in. Kindly help me to fix this issue.

Upvotes: 0

Views: 1049

Answers (1)

Udara Kasun
Udara Kasun

Reputation: 2216

Try to update your web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="Redirect to https" stopProcessing="true">
                    <match url=".*" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Upvotes: 1

Related Questions