HTTPS redirects and IIS
by liquidpooled on Jun.09, 2008, under Microsoft, Office, Sharepoint Server, Windows SharePoint Services
Not quite SharePoint specific, but sometimes necessary is the ability to redirect a http connection (port 80) to a https connection (port 443) for an entire site. While there are several ways to do this, one way that works for both SharePoint and IIS 6.0 in general is the following (*Note this is for SharePoint):
- Create a new html file in your 12 hive (this way your virtual directory for IIS is already created by the SharePoint instance).
- httpsredirect.htm
- Place your file in the 12 Hive (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\httpsredirect.htm)
- Enter the following in the html file created in step 1:
<html> <head> <title>HTTPS Redirector</title> <SCRIPT type="text/javascript"> <!-- if (location.protocol != 'https:') { window.location = 'https://'+ location.host + location.pathname + location.search; } // --> </SCRIPT> </head> <body> </body> </html> - Define your custom error page in IIS for 404.3 errors for each SharePoint site which you want to be SSL only.
- Select the 404.3 error in the properties dialog for the website.
- Browse to the custom file you created (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\httpsredirect.htm)
- Make sure that you are leaving the type as “File”
- Browse your site as http and you will be redirected to the SSL site.
No comments for this entry yet...