HTTPS problem

Please support our eCommerce advertiser: Get a Free E-commerce Success Analysis!
Thread Solved

Join Date: Feb 2008
Posts: 49
Reputation: emhmk1 is an unknown quantity at this point 
Solved Threads: 0
emhmk1 emhmk1 is offline Offline
Light Poster

HTTPS problem

 
0
  #1
Aug 5th, 2008
Hi Everyone.

This may seem a pretty basic question but here goes....
on my domain https:// if you take away the 's' from the http you can still view the secured section, what i need is it to either provide an error or better still make the page redirect to where they are and replace the 's' in the url....if you get what i mean.

Sorry to appear vague ....... any ideas?
The site is in php too if that helps......or not!


Cheers
EMHMK1
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: HTTPS problem

 
0
  #2
Aug 5th, 2008
The best thing you can do is force the page to be viewed only by https which is not hard to do and can be done several ways. (BTW, unless you link to the non https version of that page users should never be able to get there in the first place unless they're doing something naughty).

To do it with Apache put this code in a file called .htaccess in the same directory as the file you want to force the http:

Redirect permanent http://www.domain.com/page.php https://www.domain.com/page.php

If you're using PHP you can put this at the top of the page to accomplish the same thing:

  1. <?php
  2. $https_url = 'https://www.domain.com';
  3. if ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'off' )
  4. {
  5. header('location: ' . $https_url);
  6. exit;
  7. }
  8. else if ( !isset( $_SERVER['HTTPS']) && $_SERVER['SERVER_PORT'] == 443 )
  9. {
  10. header('location: ' . $https_url);
  11. exit;
  12. }
  13. ?>
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 49
Reputation: emhmk1 is an unknown quantity at this point 
Solved Threads: 0
emhmk1 emhmk1 is offline Offline
Light Poster

Re: HTTPS problem

 
0
  #3
Aug 6th, 2008
Cheers Sty,

The php version is a peach.

Thanks very much.

EMHMK1
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the eCommerce Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC