Hello Coders, If you have redirection issues of PHP HTTP or HTTPS Redirect on your PHP website, then you can consider the below source. Little explanation about HTTP and HTTPS below,
HTTP (HyperText Transfer Protocol)
From the above heading, you get the full form of HTTP. On the basis of coding or on the technical language you can say HTTP is not a secure way to transfer data on the website,
Ex: If any user login to account and enter the password like “Bikash123” it displays the complete password as it is to the hacker. On the other hand, if you use HTTPS enter the password like “Bikash123” and hacker see “avhjbjsd3232x” like that.
HTTPS (Hypertext Transfer Protocol over Secure Socket Layer)
Above is the full form of HTTPS and also called HTTP over SSL This is called secure server because of SSL.
Check below how to Redirect PHP website HTTP or HTTPS
1 2 3 4 5 6 7 8 9 10 11 12 |
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { // HTTPS } else { // HTTP } |
Aslo Check: How to Create Pagination in PHP with Ajax
Happy Coding..!