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

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

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
bemara57
Asked:
bemara57
  • 3
  • 2
  • 2
  • +1
1 Solution
 
steelseth12Commented:
You can use absolute paths e.g http://www.example.com/mypage.php
0
 
ClickCentricCommented:
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
 
bemara57Author Commented:
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
OscurochuCommented:
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
 
bemara57Author Commented:
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
 
bemara57Author Commented:
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
 
OscurochuCommented:
im not sure what you mean exactly anymore...
0
 
ClickCentricCommented:
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

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

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