Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Setting up DT Donate with SSL

Setting up DT Donate with SSL 10 years 5 months ago #4369

  • dthadmin
  • dthadmin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 5470
  • Thank you received: 3
If you want to force DT Donate to use an SSL url, then take this code and paste it into the <head> tag of your joomla template. It works for both DT Donate and DT Register. If you do not have both, that is fine.
<?php 
// toggle in and out of SSL
// check the URL for modules that need SSL
if ((strpos($_SERVER["REQUEST_URI"], "com_dtregister") > 0) || (strpos($_SERVER["REQUEST_URI"], "com_dtdonate") > 0 )|| $_REQUEST['option']=='com_dtdonate' || $_REQUEST['option']=='com_dtregister')
{   
    // only rewrite the URL once, if you are not in https: mode
    if ($_SERVER['SERVER_PORT'] == 80)         
    {   
      if($_SERVER['REQUEST_METHOD']=='POST'){     
      }else{
         header( 'Location: https://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
      }
    }
}
// check to see if https: is not required
if ((strpos($_SERVER["REQUEST_URI"], "com_dtregister") === false) && (strpos($_SERVER["REQUEST_URI"], "com_dtdonate") === false) && $_REQUEST['option']!='com_dtdonate' && $_REQUEST['option']!='com_dtregister')
{
    // only rewrite the URL once, if you are already in https: mode
    if ($_SERVER['SERVER_PORT'] == 443)         
    {         
      if($_SERVER['REQUEST_METHOD']=='POST'){   
      }else{     
              header( 'Location: http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
      }
    }       
}   
?>

Please Log in or Create an account to join the conversation.

Setting up DT Donate with SSL 10 years 5 months ago #4381

  • bstaglin
  • bstaglin's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 0
Dear DTH Admin,

Thanks so much for posting that code! I spent all of yesterday trying to figure out how to consistently and exclusively force SSL for DT Register and DT Donate. Your code works like a charm!

Brandon

Please Log in or Create an account to join the conversation.

Setting up DT Donate with SSL 10 years 3 months ago #4721

  • Techson33
  • Techson33's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 0
I tried using the code you provided and now that code shows up at the top of my pages.

I even installed a custom head tag plugin and inserted your code in there and same thing. code shows up at the top of page.

this is my header code.
<head>

This is where I put your code. Is this where it goes.

<jdoc:include type="head" />

Please Log in or Create an account to join the conversation.

Setting up DT Donate with SSL 10 years 3 months ago #4725

  • dthadmin
  • dthadmin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 5470
  • Thank you received: 3
This code should be inside of a PHP tag. You may need to put a <?php in front of your code. This would be why it is showing on the screen. I have just modified the code in this post to include this.

Please Log in or Create an account to join the conversation.

Setting up DT Donate with SSL 9 years 5 months ago #8046

  • kmctf
  • kmctf's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
I have this error from the browser:

The page isn't redirecting properly

I inserted the code inside the <head> of my template. My website is running Joomla 1.5.18, DT Donate 2.2.3 and DT Register 2.6.7a

Please Log in or Create an account to join the conversation.

Setting up DT Donate with SSL 9 years 1 week ago #10042

  • rblanda
  • rblanda's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0
Im getting the same error. As soon as I enable the SSL plugin, firefox tells me that "this page is redirecting...in a way that will never complete"

I have to disable the SSL plugin just to use my site. In turn, that makes IE freak out and give me that "some elements on this page are insecure" message.

It's driving me nuts. *banging head on desk*

- Blanda

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Time to create page: 0.073 seconds