Azure traffic manager, redirect HTTPS://www.my.site.com to HTTPS://my.site.com

2.4k views Asked by At

My marketing team accidentally created materials with an additional 'www' sub domain and I need to see if I can remove it using Azure traffic manager.

Marketing domain (incorrect) HTTPS://www.my.site.com

Desired domain HTTPS://my.site.com

I only have a wildcard cert for *.site.com so at this time I cannot support the 'www'.

If the user enters the 'www' site over HTTP I can successfully redirect to the correct site. If they enter the HTTPS, or use Firefox that defaults to HTTPS, they will see a certificate error for HTTPS://www.my.site.com.

Would a second wildcart cert for *.my.site.com help? I am not sure where I would configure it.

Any help would be appreciated, thanks.

1

There are 1 answers

2
Byron Tardif On

The certificate you have should be enough since its a wildcard cert, no need to buy another one.

I think this can be fixed by adding another host-name to your app and creating another SSL binding.

That means you need to add the www.my.site.com host-name (make sure to assign it to the traffic manager url):

Hostname

And then do the binding:

Binding

Once that is done both URLs will work through SSL.

If you want to then have all traffic from going to you can then add a URL re-write rule:

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="SPA">
                    <match url="OLDURL" />
                    <action type="Rewrite" url="NEWURL" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

You can look at this other answer to get more data: Rewriting a URL in an Azure web app