Solved

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

Posted on 2011-09-11
4
463 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Suggested Solutions

#SSL #TLS #Citrix #HTTPS #PKI #Compliance #Certificate #Encryption #StoreFront #Web Interface #Citrix XenApp
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now