Solved

Ho do I stop HTTPS:// from being passed to every page after the first time?

Posted on 2007-03-22
8
989 Views
Last Modified: 2012-05-07
Whenever someone hits an SSL page and goes back into a regular page, the https:// sticks to every page afterwards. How do I prevent this from happening? Do I have to put a PHP or ASP code that checks for this on every page that doesn't ever need to be SSL?
0
Comment
Question by:bemara57
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 20

Expert Comment

by:steelseth12
Comment Utility
You can use absolute paths e.g http://www.example.com/mypage.php
0
 
LVL 10

Expert Comment

by:ClickCentric
Comment Utility
Yes.  But why would you?  If the page works, it shouldn't matter if you're using http or https as long as the site has a vaild ssl certificate.
0
 

Author Comment

by:bemara57
Comment Utility
The reason is because it put unnecessary strain on the server. Also steelseth, as simple as using absolute paths sounds, it wouldn't be good because my forwarded domains would get switched to the master domain, even if the forwarded domains are masked.

Is there any better way? I mean doing a find/replace to just replace the https to http in the location.address would be much easier than changing all my links to include full paths. But is there any native functions to ASP, PHP or even Apache?
0
 
LVL 5

Accepted Solution

by:
Oscurochu earned 500 total points
Comment Utility
i agree with ClickCentric, but i will help anyways

<script type="text/javascript">
<!--//Hide from old browsers
document.onload=function(){
  if ( this.location.href.indexOf('https://') ) {
    this.location.href = 'http://'+this.location.href.replace("https://", '');
  }
}
//-->
</script>


its a start, you can fix it to how you need it.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:bemara57
Comment Utility
How about putting all your encrypted pages into an sslfolder and have Apache do a rewrite of http to https for anything in that folder. Does Windows IIS have something similar?
0
 

Author Comment

by:bemara57
Comment Utility
I say that because I've tried to mess with the location in the code before (to switch back and forth from http and https) and IE7 didn't let the certificate fully pass. It was much more stricter than IE6 or Firefox.
0
 
LVL 5

Expert Comment

by:Oscurochu
Comment Utility
im not sure what you mean exactly anymore...
0
 
LVL 10

Expert Comment

by:ClickCentric
Comment Utility
Wait..you want to redirect people to another page to avoid putting unnecessary strain on your server?   You do realize that the redirection would be just as much or possibly even more strain since it would have to process 2 requests rather than one, yes?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now