Solved

How would I redirect an HTTP URL to a HTTPS URL?

Posted on 2013-11-17
12
600 Views
Last Modified: 2013-12-11
We have URL that I would like to redirect to an HTTPS url.

Tried  redirect function in IIS7 but did not work.  Does redirect in IIS only work when redirecting  HTTP to HTTP?

Thanks
0
Comment
Question by:PDSWSS
  • 7
  • 3
  • 2
12 Comments
 
LVL 31

Expert Comment

by:Frosty555
ID: 39654890
Not sure if this is your issue, but If your site *requires* SSL, then it will fail with a 403 Forbidden error before it gets a chance to perform any sort of HTTP redirect.

Depending on what you're using IIS for, it may not be advisable to change the SSL requirements to allow non-SSL connections. For example, when you're working with Outlook Web Access on Exchange Server all the various Exchange Server related sites inherit their settings from the top level "Default Web Site", which is where the SSL Required flag is set. If you change it, you have to go into all of the sub-sites and manually reconfigure them to require SSL, it's a significant configuration change to get it working and IMHO quite scary to do to a production Exchange server.

If this is what your problem is, one thing I've done successfully is create a custom "403.4" Error Page under Default Web Site, configure it to respond with a 302 Redirect to your HTTPS address. The 403.4 error code is specifically the "Forbidden because SSL is required" error code.

Works like a charm for me.

Dialog box for configuring 403.4 error page
0
 

Author Comment

by:PDSWSS
ID: 39654925
Thanks. To clarify, I had set up this redirect for our Sharepoint site 3 years ago, after I secured the site with an HTTPS URL and a certificate.  

When I renewed the certificate the redirect stopped working. Unfortunately I do not remember how I set it up.
0
 
LVL 11

Expert Comment

by:hecgomrec
ID: 39656891
Redirect will work only in you are using a different site... lets says if users types: remote.yourdomain.com you'll redirect to remoteweb.yourdomain.com and for this you'll create a site in your II7 with the redirect option.

To enable or force the use of https open for the desire site the SSL Settings and click on Require SSL and the type of Client certificate to use.

Remember to add a binding on the website to the SSL port and IP you need.
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

Author Comment

by:PDSWSS
ID: 39667788
Have not had the time to check the solution. Will do as soon as possible. Thanks
0
 

Author Comment

by:PDSWSS
ID: 39676510
hecgomrec:   Odd set of events.

I followed your suggestion and then tried  the http URL and I got an empty page.
Next I undid the changes to the SSL settings page that you had suggested and just for the fun of it tried the  http URL again. Now it SURPRISINGLY redirected to the HTTPS URL and the site opened.
Hard to explain this behavior.  Should I give you the points?  Have no idea what caused the redirect to work after I unconfigured the SSL changes that you suggested.

This issue is solved but not really clear what fixed the issue. Thanks
0
 
LVL 31

Expert Comment

by:Frosty555
ID: 39679833
PDSWSS - could this have been a browser caching issue? Or you needed to do an iisreset and restart the IIS services before the changes took effect?
0
 

Author Comment

by:PDSWSS
ID: 39680790
Could have been a browser caching issue.  But all URLS and redirects were the same as
before I upgraded the certificate so not clear how would be a caching issue.

Not an iisreset issue since I had reset IIS multiple times.
Thanks
0
 
LVL 11

Expert Comment

by:hecgomrec
ID: 39683539
Well I'm not here for the points, I'm happy that is working but will try to figure out how if you don't have a SSL port binding you can still go to it.  Or are we missing something????
0
 

Author Comment

by:PDSWSS
ID: 39686972
There is a certificate binding to port 81 for this URL that I set up in IIS7.
Doesn't that indicate that SSL port binding has been set up?
0
 

Accepted Solution

by:
PDSWSS earned 0 total points
ID: 39701846
The situation resolved itself. Hard to explain.
0
 

Author Closing Comment

by:PDSWSS
ID: 39710853
Experts provided input but none of the suggestions solved the issue. Thanks,
0
 
LVL 11

Expert Comment

by:hecgomrec
ID: 39711286
Come on... miracle!!!!
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Install IIS7.5 on Windows Sever 2012 R2 4 31
GPO reset 2 40
DNS forwarders "unable to resolve" 1 54
Secure log in 'box' 4 8
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
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…

680 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