PHP and SSL
Date: 08/16/06
(PHP Community) Keywords: php, jsp, web
How would one go about making portions of a website serve through HTTPS? I'm thinking of something like here at LJ, where only the login and some internal pages are served via HTTPS; all the rest are via ordinary HTTP.
Frankly, I'm even a little confused as to HOW exactly making a web application serve via HTTPS. I've been doing a lot of Googling, and all I can see are how to set up SSL with servers et al—which are too technical for me. I understand I can ask my host to enable SSL; but after that? I seem to "get" that after that, a new folder will be open to me where I should place the pages I mean to make secure. Is this correct? So that means I either have a few pages of my application in one folder, and the rest in another; or two full copies of the application in both folders. Right?
So if I just need certain pages to be served from it, like the login page, user profile page, etc—is it really as "simple" as putting those pages in the secure folder instead of the normal folder, linking to it via the https protocol, and then linking/redirecting back to http after? (Never mind the whole "but the cookie will still be present, you have to put the whole application in https!" argument because if it's one-tenth in terms of speed, that's definitely a no-no.)
What happens if I use a page loader to load the application pages? I then have to put the page loader etc into the secure folder then, right?
And, I seem to read that with JSP there's a way to "transparently" do this—I mean redirecting automatically (i.e., if user tries to go to http://website.com/login.jsp, it gets redirected to https://website.com/login.jsp automatically; or, https://website.com/whateverpage.jsp goes to http://website.com/whateverpage.jsp because it doesn't need to be served via HTTPS). Is there a way to do this with PHP?
Thanks in advance, I'm getting rather frustrated with Googling since I don't seem to get any headway at all into this. :p
Source: http://community.livejournal.com/php/484250.html