?
Solved

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

Posted on 2007-03-22
8
Medium Priority
?
998 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 5

Accepted Solution

by:
Oscurochu earned 2000 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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.
Suggested Courses

771 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