How to redirect http to https web page?

Hi everyone,
I'm trying to redirect folks from an http web page to https automatically in iis. I've tried several scripts online but it doesnt seem to work. It is just giving me a blank page. Its almost as if the asp page is not running the script.
Thanks for the help.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

On the HTTP site, create a file default.asp with the following code:


Go to the HTTP site configuration and check that the default start page is "Default.asp".


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
If you are using ASP can you not just do the redirect inside the ASP page?

i.e. Reponse.Redirect("") ?
Would you happen to be needing this for an site? If so here's a solution that I use all the time... it works great!

"Switching Between HTTP and HTTPS Automatically: Version 2" by Matt Sollars
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

cireduranAuthor Commented:
Hi everyone,

Thank you for the responses. Unfortunately response.redirect I've tried previously and did not work. I just get a blank page.
Maybe this:

<body onload='javascript:go();'>
<script language=javascript>
function go()

With regards to JuanCarniglia's comment, the open and close tags are <% and %> not <? ?>

Therefore, check you are :-
Also check that default.asp is the default document in IIS.

Are the http site and the https site totally unique sites? Or do they use the same files?


DanJourno, thanks for making that clear. I confused ASP and PHP for a while :)

cireduranAuthor Commented:
the http site and the https site are the same site.
In that case <% response.redirect("") %> wont work on its own.
If you try using it on its own, the server will constantly redirect and never stop on a page.

If you rename the https homepage to https.asp (assuming the homepage is an asp page), then use the following code in the default.asp page, this should stop it from constantly redirecting.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.