简体   繁体   中英

IIS 7 URL Rewrite for HTTPS

I want to redirect https://example.com to https://www.example.com . I have the following rule for redirecting non www http traffic to https://www . . .

<rule name="WWW Redirect1" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^example\.com$" />
    </conditions>
    <action type="Redirect" url="https://www.example.com/{R:1}" />
</rule>

This will not handle redirecting from https://example.com to https://www.examlple . Right now I currently get the SSL cert error, is it even possible to avoid this?

If you are getting an SSL certificate error, it likely means that either

  1. Your web server is not serving up an SSL certificate for https://www.example.com or;

  2. Your SSL certificate is for example.com not www.example.com . In which case, you'll likely need to address that with your SSL certificate provider.

Not sure that it is an issue with code or config....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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