[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2011-09-11
4
Medium Priority
?
488 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 1000 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 1000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Suggested Courses

873 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