简体   繁体   English

IIS 8中的HTTP到HTTPS重定向

[英]HTTP to HTTPS redirect in IIS 8

https://testitnow.in/edgar is the website which is built on ASP. https://testitnow.in/edgar是基于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." 我在IIS中配置了自动重定向,但是如果在Web浏览器中键入testitnow.in,我仍然收到以下错误-“ 403-禁止访问被拒绝。您无权使用凭据查看此目录或页面您提供的。”

But if I type https://testitnow.in or www.testitnow.in it is redirecting to https://testitnow.in . 但是,如果我输入https://testitnow.in或www.testitnow.in,它将重定向到https://testitnow.in Kindly help me to fix this issue. 请帮助我解决此问题。

Try to update your web.config 尝试更新您的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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM