Solved

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

Posted on 2007-03-22
8
993 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
ID: 18776484
You can use absolute paths e.g http://www.example.com/mypage.php
0
 
LVL 10

Expert Comment

by:ClickCentric
ID: 18776548
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
ID: 18776699
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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 5

Accepted Solution

by:
Oscurochu earned 500 total points
ID: 18776704
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
 

Author Comment

by:bemara57
ID: 18776734
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
ID: 18776770
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
ID: 18777204
im not sure what you mean exactly anymore...
0
 
LVL 10

Expert Comment

by:ClickCentric
ID: 18777377
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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
I think I know what this error means, but I need some other eyes on it... 32 52
php help 34 58
CREATE DATABASE 3 30
Delete  php pages of a part of our site 8 33
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

830 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