0

Ok so for my register.php page I want to use https however the code that I am using makes my whole site use https how do I make it so only my register page uses https?

Code I'm using:

 if(!isset($_SERVER['HTTPS'])) { header("location: https://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
4
Contributors
5
Replies
33
Views
3 Years
Discussion Span
Last Post by LastMitch
0

You want to use https .. do you have ssl certificate ? If you haven’t don’t use https … In your basic code you use $_SERVER['REQUEST_URI']
So check that primitive variable that is the page that you want to apply the rule for and if it is apply it ..

0

I've also done

if(!isset($_SERVER['HTTPS'])) { header("location: https://........../login.php" );}

but it still makes my whole site https I just want my login.php page to be https, and I do have SSL certificate.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.