Solved

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

Posted on 2010-11-23
7
711 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
[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
  • 3
7 Comments
 
LVL 26

Expert Comment

by:Tony Johncock
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 26

Expert Comment

by:Tony Johncock
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 26

Expert Comment

by:Tony Johncock
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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
how to add IIS SMTP to handle application/Scanner relays into office 365.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

632 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