• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 522
  • Last Modified:

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.
0
cireduran
Asked:
cireduran
  • 3
  • 2
  • 2
  • +2
2 Solutions
 
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
 
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
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 
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

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now