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.
cireduranAsked:
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.

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

<?
   Response.Redirect("https://whatever.com")
?>

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

Greetings
0

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
justin-clarkeCommented:
If you are using ASP can you not just do the redirect inside the ASP page?

i.e. Reponse.Redirect("https://xxxxxx.com") ?
0
Rikus_TrentCommented:
Would you happen to be needing this for an asp.net 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
http://www.codeproject.com/KB/web-security/WebPageSecurity_v2.aspx
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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.
0
JuanCarnigliaCommented:
Maybe this:

<html>
<body onload='javascript:go();'>
</body>
</html>
<script language=javascript>
<!--
function go()
{
  window.location.navigate("https://myothersite");
}
-->
</script>
0
DanJournoCommented:
Hi,

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

Therefore, check you are :-
<%
   Response.Redirect("https://whatever.com")
%>
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?

Dan

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

Greetings.
0
cireduranAuthor Commented:
the http site and the https site are the same site.
0
DanJournoCommented:
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.

<%
response.redirect("https://www.yourdomain.com/https.asp")
%>
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.