Saturday, January 7, 2012

Turn On - Off HTTPS Using PHP / Redirect From HTTPS To HTTP Using PHP !

If your website is using HTTPS -- We Know it Slows up loading!
Now it is not mandatory to using HTTPS on whole site..
May be you want a part of your site Like "Blog Section" or "Forum Section" not to use HTTPS.

This code uses the $_SERVER['HTTPS'] variable to see if HTTPS is turned on, if it is then a header is issued and the page redirected.


NOTE: Don’t include both of these codes on the same page or your site will go crazzy! 
Also, make sure that no headers have been issued before hand as this code can cause a "headers already sent" error.

 

0 comments:

Post a Comment