Solved

Multi-Domain Re-direct (HTTP://* -->HTTPS://www.)

Posted on 2011-09-11
4
474 Views
Last Modified: 2012-05-12
Hi all,

I have a single IIS 7 site, responsible for three different domains.  Each domain needs to point to a different directory.  Also, I would like to automatically redirect the the "https://www" root for any requests that come in.

Domains and Mappings:
1)  domain1.com -> https://www.domain1.com/sub1/
2)  domain2.com -> https://www.domain2.com/sub1/domain2.aspx
3)  domain3.com -> https://www.domain3.com/sub1/domain3.aspx

Can anyone assist me?  I'm trying to get URL re-writing to work, but have been unsuccessful so far.  Maybe there is a better alternative?
0
Comment
Question by:ITDeptAtPCS
4 Comments
 
LVL 14

Assisted Solution

by:setasoujiro
setasoujiro earned 250 total points
ID: 36519512
0
 
LVL 1

Author Comment

by:ITDeptAtPCS
ID: 36519618
That helps for handling multiple domains within one site.  The next issue is that the certificate I have is a multidomain cert from GoDaddy.  It covers the www subdomains of the domains listed above.

I want to make sure that no matter what someone enters, they are taken to https://www.domainX.com and the appropriate path listed above.
0
 
LVL 4

Accepted Solution

by:
vaibhavjaiman earned 250 total points
ID: 36521120
Hello,

please check the below script use to rewrite the http request to https using the MS URL rewrite
You can place it under the web.config

<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
0
 
LVL 17

Expert Comment

by:Rovastar
ID: 36532871
For the above rewrite rule yes it will work but you need to note that "require SSL" has to be disabled in IIS. Personally I like IIS to enforce this. You can 2 sites in IIS one a http one a https site and redirect from http site to the https site.  I consider this a better solution and teh best of both worlds.

More details here at point "4. Redirect to HTTPS" in this blog by Microsoft employee, Ruslan Yakushev, who helped write the URLrewriter in IIS

http://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

#SSL #TLS #Citrix #HTTPS #PKI #Compliance #Certificate #Encryption #StoreFront #Web Interface #Citrix XenApp
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question