Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 6th Oct 2010, 09:56 PM   #1
Warrior Member
 
Join Date: 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default
htaccess trouble
Share on: 
fb share twitter share gplus share more share

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.
doitprint is offline  
Unread 7th Oct 2010, 06:27 PM   #2
Advanced Warrior
War Room Member
 
Join Date: 2005
Posts: 914
Thanks: 469
Thanked 149 Times in 93 Posts
Default
Re: htaccess trouble
Share on: 
fb share twitter share gplus share more share

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']);
}?>
Marketing Profits Software is offline  
Closed Thread


Bookmarks

Tags
htaccess, redirect, trouble


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 11:38 PM.