| | #1 |
| Warrior Member Join Date: 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
I've been having a lot of trouble with the whole http/https thing. I need everything but 4 pages to be forced to http whatever they were going to. Then these pages (signup.php, login.php, edit-profile.php, and edit.settings.php)need to be forced to https I really don't understand htaccess and I've read a lot of tutorials, but when I go to implement I fudge it up. I've caused several loops and other problem and this is a live e-commerce site. I can get everything to go one way or the other, but I can't seem to get this to happen. Please advise. Any help in rectifying this will be most appreciated. |
| |
| | #2 |
| Advanced Warrior War Room Member Join Date: 2005
Posts: 914
Thanks: 469
Thanked 149 Times in 93 Posts
|
To force a secure connection, add the following code to the top of the specified PHP files: Code: <?php if ($_SERVER['SERVER_PORT'] != 443) {
header('Location: https://yourdomain.com/'.$_SERVER['PHP_SELF']);
}?> |
| |
|
| Bookmarks |
| Tags |
| htaccess, redirect, trouble |
| |