Solved

How do I perform a URL redirection from HTTP to HTTPS to another URL?

Posted on 2010-11-23
7
696 Views
Last Modified: 2012-05-10
Hi Experts,

I have two websites on one server using the same IP address and each references
a different URL.
 
Website1 - Default website has URL of mail.abc.com
Website2 - Jog website has URL of mail2.abc.com

Using appcmd + a combination of host headers and bindings, i've set these settings on my
websites:

%windir%\system32\inetsrv\appcmd set config "Default Web Site" /section:httpRedirect /enabled:true /destination:"https://mail.abc.com/owa" /childOnly:"true" -commit:apphost
%windir%\system32\inetsrv\appcmd set config "Default Web Site" /section:httpErrors /-"[statusCode='403',subStatusCode='-1']" -commit:apphost
%windir%\system32\inetsrv\appcmd set config "Default Web Site" /section:httpErrors /+"[statusCode='403',path='https://mail.abc.com/owa',ResponseMode='Redirect']" -commit:apphost
%windir%\system32\inetsrv\appcmd set site /site.name:"Jog" /+bindings.[protocol='http',bindingInformation='*:443:mail2.abc.com']
%windir%\system32\inetsrv\appcmd set site /site.name:"Jog" /+bindings.[protocol='http',bindingInformation='*:80:mail2.abc.com']
%windir%\system32\inetsrv\appcmd set config "Jog" /section:httpRedirect /enabled:true /destination:"https://mail2.abc.com/owa" /childOnly:"true" -commit:apphost
%windir%\system32\inetsrv\appcmd set config "Jog" /section:httpErrors /-"[statusCode='403',subStatusCode='-1']" -commit:apphost
%windir%\system32\inetsrv\appcmd set config "Jog" /section:httpErrors /+"[statusCode='403',path='https://mail2.abc.com/owa',ResponseMode='Redirect']" -commit:apphost

I am trying to set up these things:
1. URL redirection from HTTP to HTTPS
2. URL redirection from mail.abc.com to https://mail.abc.com/owa
3. URL redirection from mail2.abc.com to https://mail2.abc.com/owa

For Website1, when a user types mail.abc.com:
http://mail.abc.com -> redirects -> https://mail.abc.com/owa [THIS WORKS AS INTENDED]
http://mail.abc.com/owa -> redirects -> https://mail.abc.com/owa [THIS WORKS AS INTENDED]

For Website2, when a user types mail2.abc.com:
http://mail2.abc.com -> FAILS with a 500 error
http://mail2.abc.com/owa -> redirects -> https://mail2.abc.com/owa [THIS WORKS AS INTENDED]

Ideally http://mail2.abc.com should redirect to https://mail2.abc.com/owa but it's not working.

I've tried enabling SSL on both websites as well as disabling them. Both have the same result.
I've tried to setup IIS logs to capture 500 errors but no logs are generated. Any idea how to
solve this problem?
0
Comment
Question by:jacque1
  • 4
  • 3
7 Comments
 
LVL 25

Expert Comment

by:Tony1044
ID: 34198344
Did you follow this technet article:

http://technet.microsoft.com/en-us/library/aa998359(EXCHG.80).aspx

And do the IIS redirection bit too? I mean the bit about the custom error.

0
 

Author Comment

by:jacque1
ID: 34198444
Yes I've tried that...didn't work. I do not want the user to click on a custom page but to be redirected to the main owa page.
0
 
LVL 25

Expert Comment

by:Tony1044
ID: 34198459
No it should require them to click anything - what that technote does is change the error from "you need to connect to this page by SSL" (paraphrasing) into an automatic redirection to https://domain.com/owa
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:jacque1
ID: 34202206
I'm using W2K8 and followed the article:
"For a Configuration in Which SSL Is Required on the Default Web Site or on the OWA Virtual Directory in IIS 7.0 - To use IIS Manager to simplify the Outlook Web Access URL and redirect users to HTTPS"

I've set my 2 websites to Require SSL. and this is the appcmd entry that I had set to enable the redirection:

%windir%\system32\inetsrv\appcmd set config "Default Web Site" /section:httpRedirect /enabled:true /destination:"https://mail.abc.com/owa" /childOnly:"true" -commit:apphost

%windir%\system32\inetsrv\appcmd set config "Jog" /section:httpRedirect /enabled:true /destination:"https://mail2.abc.com/owa" /childOnly:"true" -commit:apphost

yet it doesn't work...

the exact error I get is
500 - Internal Server Error
There is a problem with the resource you are looking for, and it cannot be displayed.
0
 

Accepted Solution

by:
jacque1 earned 0 total points
ID: 34203397
Hi, I've solved this issue. it was a server problem and not configuration. thanks anyway.
0
 
LVL 25

Expert Comment

by:Tony1044
ID: 34203404
Care to share? That way if anyone else has a similar problem they have a resolution.
0
 

Author Closing Comment

by:jacque1
ID: 34224777
I resolved my own problem.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

760 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

20 Experts available now in Live!

Get 1:1 Help Now