?
Solved

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

Posted on 2011-09-11
4
Medium Priority
?
479 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Suggested Courses

801 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