Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have a secured folder that requires SSL. I have set it up in IIS(6) to require SSL. We don't want the visitors to be greeted with the "must be secure connection" error, so I have modified the 403.4 error page to contain the following:

<script type="text/javascript">
function redirectToHttps()    {

    var httpURL = window.location.hostname+window.location.pathname;

    var httpsURL = "https://" + httpURL ;

    window.location = httpsURL ;


And this solution works great for every browser, but IE7. On any other browser, if you type in it will automatically redirect you to with no message or anything (the intended action). But in Internet Explorer 7 ONLY it will bring up a page that says

The website declined to show this webpage
Most Likely Causes:
This website requires you to log in

This is something we don't want of course. I have verified that javascript is enabled, and the security settings have no effect, even when I set them to the lowest level I get the same error.

I'm wondering, has anyone else seen this before?

share|improve this question

My guess is that IE's "Friendly Error Message" feature is replacing your error page with one it thinks is easier for people to understand. According to this kb article, the "friendly error message" is not used when the server response is large enough, and suggests padding your custom error page with spaces until it is.

share|improve this answer

I never experience it before, but, i wonder why you use javascript to do it ? Ever tried with the

<meta http-equiv="REFRESH" content="0;url="> ?

The way I deal with this problem was easy, since I use ASP.NET. You make an abstract page class or HttpModule (entire web app) that check if (!Request.IsSecure) ... redirect with a 301 to secure page.

This nice thing about doing it server-side is that it will work without javascript. I'm pretty sure you can do the same in any language (Java, PHP, ruby even c++ if you're old school).

share|improve this answer

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.