Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I"ve got a client who currently has a site that's not SSL who wants to print materials with a URL on them. However, we're going to SSL in the next couple of months and I want to make sure that the URL we publish will seamlessly redirect if we have to.

I'm running ASP Classic (and some .NET) on Windows Server 2003 64-bit running in 32-bit mode.



share|improve this question
Any URL Rewriting module can do that -- issue a 301 Permanent Redirect (or any other 3xx code). For example: (for IIS 6) Helicon ISAPI_Rewrite v3 -- syntax is almost identical to the one used by Apache's mod_rewrite. – LazyOne Sep 10 '11 at 0:28

It isn't necessarily the best idea from a security standpoint. Someone could perform a MITM attack while the user is initially connecting to the http and redirect the user to an evil site, instead of your trusted site. OTOH, redirecting to https from an http site is very common.

Setting up a redirect in IIS is pretty easy. Here is a description of the procedure.

share|improve this answer
Note: The link only describes how to redirect any URL on one site to a single URL on another site (the https version in your case). If you need a more robust solution to redirects any URL to the corresponding/matching URL on the https site, you'll need to add some URL rewriting module to IIS, or write some ASP/ASP.NET to do the routing for you. – Mufasa Sep 12 '11 at 12:23

Couldn't you just set your site to require SSL, then modify the 403.4 custom error page to automatically redirect to https? I had used this kind of thing for years before we started terminating ssl at the load-balancer. The code on the 403-4.htm custom error page would be something like this:

<html><head><title>Error 403.4</title>

<meta name="robots" content="noindex">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"></head>


<script language="JavaScript">
var href = self.location.href;
var originalURL = href.substring(7,href.length);
self.location = 'https://' + originalURL;


This is a pretty old script that's been around for a while and there's probably a cooler way to do it but this works fine.

share|improve this answer
This worked great for me! – Corey Feb 9 '12 at 16:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.