Switching between HTTP and HTTPS
Posted: Thu Nov 16, 2006 12:11 am
Hi there,
First the mandatory disclaimer - yes I have been through the previous posts and researched quite a bit on this, but to no complete avail thus far, hopefully somebody here can point me in the right direction - what I've read so far has been very helpful.
I'm in the process of setting up an online store.
At the point of taking the order details from the customer (name, address etc), I hard code a link to the orderform
(ie. <a href="https://www.sitename.com/orderform.php)
Thus switching from HTTP to HTTPS. This is easy to ensure with my host, as they have it set up so that any files in the httpsdocs folder are only available when the address is https://etc, .. so ensuring HTTPS is not an issue.
The issue I am having is that once https://www.sitename.com/orderform.php has loaded, all my links change to reflect https://etc. ie. links back to the home page, links to orderfrom2
Now of course want orderpage2.php and any subsequent order pages to remain in HTTPS mode, however if the user backs out of the order by clicking on the HOME page, they will now be looking at the home page under HTTPS not HTTP.
It has been suggested that I hard code all the links, so that once in the order form links back to the home page will be hard coded, <a href="http://www.sitename.com/homepage.php etc
A couple of problems with this -
1. defelopment/testing on my locally hosted server very difficult as I won't be able to test on anything but the live page.
2. I use a template that is universal for everypage of the site... If I place a code that changes out from HTTPS to HTTP... it also needs to work as a regular link when someone is viewing the site and goes from HTTP to HTTP.
I hope I have explained this properly.
And many many thanks in advance for any advice, even links to tutorials/further reading, whatever it might be.
cheers,
Dogen
First the mandatory disclaimer - yes I have been through the previous posts and researched quite a bit on this, but to no complete avail thus far, hopefully somebody here can point me in the right direction - what I've read so far has been very helpful.
I'm in the process of setting up an online store.
At the point of taking the order details from the customer (name, address etc), I hard code a link to the orderform
(ie. <a href="https://www.sitename.com/orderform.php)
Thus switching from HTTP to HTTPS. This is easy to ensure with my host, as they have it set up so that any files in the httpsdocs folder are only available when the address is https://etc, .. so ensuring HTTPS is not an issue.
The issue I am having is that once https://www.sitename.com/orderform.php has loaded, all my links change to reflect https://etc. ie. links back to the home page, links to orderfrom2
Now of course want orderpage2.php and any subsequent order pages to remain in HTTPS mode, however if the user backs out of the order by clicking on the HOME page, they will now be looking at the home page under HTTPS not HTTP.
It has been suggested that I hard code all the links, so that once in the order form links back to the home page will be hard coded, <a href="http://www.sitename.com/homepage.php etc
A couple of problems with this -
1. defelopment/testing on my locally hosted server very difficult as I won't be able to test on anything but the live page.
2. I use a template that is universal for everypage of the site... If I place a code that changes out from HTTPS to HTTP... it also needs to work as a regular link when someone is viewing the site and goes from HTTP to HTTP.
I hope I have explained this properly.
And many many thanks in advance for any advice, even links to tutorials/further reading, whatever it might be.
cheers,
Dogen