Link to home
Start Free TrialLog in
Avatar of Mac
MacFlag for United States of America

asked on

HTTP to HTTPS but have 2 sub sites

Using 2012R2
I might be wrong on some terms but it should be clear enough.

I tried to redirect all traffic that use HTTP://address to HTTPS://address using the rewrite module in IIS. It worked on Subset1 but caused subset2 to become unreachable. the Browser acted like it was cycling over and over again.

I have nothing on the default web site at all so it just displays the IIS splash screen (iisstart.htm)

Its laid out like this:
Default Web Site (iisstart.htm)
|----Subset1 (default.aspx)
|----Subset2 (default.htm)

I originally started out trying to repoint the default web site to Subsite 1 because it is the most frequently used and I wanted a shorter URL, (and to eliminate anyone ever seeing the IISstart page) but doing that made reaching subset 2 fail as all the URLS got altered to the path /subset1/subset2 instead of just /subset2 .

So it seems I am stuck spelling out the whole path i.e. cmts.domain.com/subset1  and cmts.comain.com/subset2.  which is not optimal as this is a mobile app.

But shouldn't the HTTPS rewrite work with this layout anyway? Is there something about the way the sites are laid out that prevent the rewrite from working?

I also tried the HTTP Redirect built into IIS but that is an all or nothing solution. I can redirect the default site to subset1, but then nothing ever reaches subset2 and you can't change it per subset.

An I doing something wrong or am I asking the impossible?
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
how's your URL Rewrite rule looks like in the IIS setting?
Avatar of Mac

ASKER

David
Both sites need SSL (port 443) so I can't create another site.

User generated image
Ryan
I had to delete the entries to make the site work again but it was something like this:

   
 <rule name=”Redirect to HTTPS” stopProcessing=”true”>
    <match url=”(.*)” />
    <conditions>
       <add input=”{HTTPS}” pattern=”^OFF$” />
    </conditions>
    <action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” redirectType=”Permanent” />
    </rule>

Open in new window

I hand entered it into web.config and I also attempted to used the IIS URL Rewrite module which produced the same effect which was that the "folder" referenced (MCX or MC_web) are ignored. Once I even had site.domain.com/mcx/mcx/mcx/mcx/mcx/mcx.... etc show up in the browser indicating something was looping.

Ideally I wanted site.domain.com to load the /MCX "site" and if I wanted the MC_Web "site" I would use site.domain.com/mc_web
I also wanted them each to be directed to HTTPS and the default website (from IISstart.htm) to never appear.
Maybe I'm being unreasonable
Both sites need SSL (port 443) so I can't create another site. You are mistaken there. You can create as many sites as you want with SSL.  You just have to change the bindings .. ipaddress,name, port one has to be unique and you select the certificate you want to use for each site.
Avatar of Mac

ASKER

To clarify, I have one Cert and one IP available for both. I didn't want to use port numbers appended to the end.
It does sound like I am asking for something that is technically not viable under the constraints I have.
each site has to have a unique name and any web browser that supports SNI will work with it.. SNI is supported by most browsers (exceptions are very old versions of IE)
Avatar of Mac

ASKER

I didn't try that because of the default warning message that came up from the dialog box. fear of the unknown you know.
I have a meet with the developer of the contents today and I will see if they approve of this SNI idea.
Thank you for the idea.
Avatar of Mac

ASKER

Developer has not implemented SSL correctly and have some bugs to work out. Otherwise your solution would have worked as expected.