Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

http redirect to https 3

Status
Not open for further replies.
ok great... just put it in any part of the head of my page and it will redirect them to the https?

Thanks
 
If I were you I'd do this server side instead using ASP or PHP or whatever SSL your company uses. The reason being that users can turn javascript off so that your page won't redirect using a javascript solution. Additionally, the users will see the first page load, and then blip to the next page. Using a SSL solution that doesn't happen.

Here's how it's done in ASP:
Code:
<% Response.Redirect("[URL unfurl="true"]https://www.somesite.com");[/URL] %>

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
headbang.gif
[rockband]
headbang.gif
 
I am having the same issue as noslenwerd was, except for some reason my site is getting stuck in a loop of some sort.

when I add in the
Code:
window.location = '[URL unfurl="true"]https://mysite.com';[/URL]

it will redirect but then it will try to send itself to itself again... it trys to just keep redirecting to
anyone have a solution to this issue? Please help if you can.

ASJ
 
asjinfinix said:
it will redirect but then it will try to send itself to itself again... it trys to just keep redirecting to
Please first confirm that you only put the redirect script into the page of
If the issue is still, try the following in the page of
Code:
<head>
<meta http-equiv="Refresh" content="0;URL=https://mysite.com">
</head>
 
If both the http and the https point to the same directory, then you'll have to redirect to a different file name:
Code:
<% Response.Redirect("[URL unfurl="true"]https://www.somesite.com[/URL][red]/default2.asp[/red]"); %>

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Yes both http: and https: point to the same directory. I will try it with a different file name like index2.php... thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top