What I mean by smarter is that they only work if the website's root is hit.
So http://example.com
will redirect to https://example.com
but http://example.com/Contact
won't redirect at all to https.
Is there a way to get the redirect to work even if I'm not requesting the home page of the site?
Details about my configuration:
I have 1 site set with HTTPS bindings and another site with HTTP bindings that redirects to the https url.
The HTTP site contains nothing but a Default.aspx and web.config file which contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="https://loganyoung.co.za" childOnly="true" httpResponseStatus="Permanent" />
</system.webServer>
</configuration>
The Default.aspx is basically blank.
The HTTP site binds to C:\inetpub\wwwroot\example.com\redir
The HTTPS site binds to C:\inetpub\wwwroot\example.com\wwwroot
PROBLEMS
- When I add in the HTTP site set to redirect to the HTTPS site, the server never stops redirecting.
NOTE: I've not touched "Default Web Site" at all. I create an entirely new website for each one that I'm hosting.