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

TOPIC: Setting up DT Donate with SSL

Setting up DT Donate with SSL 16 years 3 months ago #427

  • dthadmin
  • dthadmin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 5470
  • Thank you received: 3
To make a SECURE DT Donate page, create a Link-URL menu item that links to this URL:
https://www.YourDomain.com/index.php?op ... m_dtdonate

This will cause users to enter a secure HTTPS area of your site when clicking the link to enter DT Donate.

Now, it is a common issue in Joomla 1.0.x of not being able to switch back and forth within your site going from secure pages to non-secure pages. To solve this for your use of DT Donate, copy and paste the following code into the <HEAD> area of your template\'s index.php file. It will cause a user to be redirected back to a non-secure HTTP url when leaving DT Donate:
<?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"]);
      }
    }       
}   
?>

This code will work for both DT Register and DT Donate. If you do not have both, it is fine.

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

Setting up DT Donate with SSL 15 years 7 months ago #2288

  • marklandry
  • marklandry's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 0
Can\'t get this to work. When I add the php code, I get an error when I try to access my site. Even without the code and the link added to the menu, I get my hosting company\'s name and my ip address when I click on the link...

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

Setting up DT Donate with SSL 15 years 7 months ago #2318

  • dthadmin
  • dthadmin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 5470
  • Thank you received: 3
mark, we changed the occurences of & in the code to just &. Please try making that change and see if it makes any difference.

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

Setting up DT Donate with SSL 14 years 10 months ago #4368

  • dthadmin
  • dthadmin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 5470
  • Thank you received: 3
The SSL template code in the top of this thread has been updated and improved. Please use it instead any previous code you may have used or attempted.

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

  • Page:
  • 1
Time to create page: 0.100 seconds