Solved

SSL Redirect IIS 6.0

Posted on 2009-05-18
5
3,034 Views
Last Modified: 2013-12-14
Hey Experts,

I followed the guide from the link below to setup a SSL Redirect script for a site we are hosting internally on IIS 6 and everything was working fine, requests for http://intranet.domain.com would receive the 403.4, a custom error message was setup in IIS to point to a directory containing an .aspx file with a simple Response.Redirect script.  Furthermore the appropriate location path was added to the web.config file.

http://weblogs.asp.net/pwilson/archive/2004/12/23/331455.aspx

All was working well until some changes to our sharepoint site were made and I received the Inheritance Overrrides error in IIS, the only child node it prompted me for was NoSSL which is the SSL redirect, this is the only service we are hosting currently, Ive seen exchange users with similar issues however this is not the case for our environment.

Regardless of whether I choose the 'NoSSL' child node or not when prompted by inheritance overrrides, the redirect stops working.  I have removed the custom error, the folder, the changes to config.aspx, etc..reimplemented them and still received the same problems.

When http://intranet.domain.com is entered the following is returned by the browser:
'Secure Channel Required
This Virtual Directory requires a browser that supports the configured encryption options.'

Thanks for the help!

Custom Error 403.4:

<%

Response.Redirect("https://intranet.domain.com")

%>
 
 
 
 

Web.conf:

  <location path="_NoSSL/SSLRedirect.aspx">

    <system.web>

      <authorization>

        <allow users="*" />

      </authorization>

    </system.web>

  </location>

Open in new window

IIS-Inheritance-Overrides.JPG
0
Comment
Question by:joefreedom
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:meverest
Comment Utility
Hi,

your snapshot shows that when you try to set the custom error page, it also wants to set the 'UNCPassword' value.

what you apparently need to do is to set the custom error without changing the UNCPassword.  You can do that in two ways:

1.  set the custom error on the 'noSSL' node, and then go back and set the UNCPassword credentials, OR
2.  set the custom error using adsutil.vbs instead of the GUI, something like:

C:\Inetpub\AdminScripts>adsutil set w3svc/1/Root/_private/HttpErrors "403,2,FILE,c:/path/errorfile.aspx"
0
 
LVL 8

Author Comment

by:joefreedom
Comment Utility
Thanks for the response I appreciate your support,

I don't know how to "set the UNCPassword credentials" so number 1 isn't an option unless you can explain how to do so?

I attempted to run the adsutil command you posted however I receive
'the path requested could not be found'
ErrNumber: -2147024893 (0x80070003)
Error trying to get the object: w3svc/1/Root/_private

Can you explain if 'w3svc', and '1' are supposed to represent an actual value?  Should the 1 represent the site id or something?

does '403,2,FILE,C:/path/errorfile.aspx' mean http error 403.2 file redirect or just 403?
Should this be '403,4,URL,_NoSSL/SSLRedirect.aspx' in my case?

Sorry I have no prior experience with adsutil utility and I have had minimal luck with resources explaining those questions.

Thanks!
0
 
LVL 8

Author Comment

by:joefreedom
Comment Utility
I Ended up using the following code in a .htm page on the root directory of the site.  I went into IIS custom errors settings and changed 403.4 to redirect to a file, browsed to the root directory and selected the .htm page.

All is working well.  Thanks for the help.
<SCRIPT type=text/javascript>

<!--

if (location.protocol != 'https:')

{

window.location = 'https://'+ location.host + location.pathname + location.search;

//alert(location.host + location.pathname + location.search); Just for sanity check
 

}

// -->

</SCRIPT> 
 

Code Taken From:

http://blog.opsan.com/archive/2005/04/17/395.aspx

Open in new window

0
 
LVL 37

Accepted Solution

by:
meverest earned 500 total points
Comment Utility
Hi,

looks like you have it sorted - good! :-)

to answer your questions:

the UNCPassword option is set when the virtual directory exists on another server and is only relevant when "a share located on another server" option is selected on the virtual directory tab of the vd properties.  In that case, click on "connect as" to set UNCUsername and UNCPassword properties.

if this vd is NOT on another server, then that property has probably been inherited (somehow) from a parent node incorrectly, in which case it would be a good idea to remove and recreate it.

for the adsutil tool, yes- the path information is important.  I probably should have written it like this:

C:\Inetpub\AdminScripts>adsutil set w3svc/<site-ID>/Root/<path>/HttpErrors "403,2,FILE,c:/path/errorfile.aspx"

you can see the siteID by looking at the 'Identifier' column in the IIS admin when you click on the 'web sites' node and view all configured sites in the right hand pane.

Cheers!




0
 
LVL 8

Author Closing Comment

by:joefreedom
Comment Utility
Thanks for all of the help, much appreciated.
0

Featured Post

New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

Join & Write a Comment

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

10 Experts available now in Live!

Get 1:1 Help Now