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

TOPIC: [SOLVED] https and http

[SOLVED] https and http 16 years 4 months ago #343

  • npt
  • npt's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 22
  • Thank you received: 0
Thank your for the additional solution! Advantage to your solution: change only has to be made in one place. Advantage to the solution I proposed: Changes only template code, not base Joomla code. FYI, here is what my code becomes (must use && operator) when you combine DtDonate (extrapolate to include any other component that needs https):
if  ((strpos($_SERVER["REQUEST_URI"], "com_dtregister") === false) && (strpos($_SERVER["REQUEST_URI"], "com_dtdonate") === false))     {  	   if ($_SERVER['SERVER_PORT'] == 443)  	   {  	   	header( 'Location: http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);  	   }  	}

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

[SOLVED] https and http 16 years 4 months ago #344

  • dthadmin
  • dthadmin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 5470
  • Thank you received: 3
Thanks for Robert for helping to locate this solution. We have tested his posted solution and will now be suggesting it to be included in your template file if you are using SSL. So, officially, IF you are using a HTTPS connection for your DT Register, paste the following code into the <HEAD> area of your template index.php file:
<?php  if ((strpos($_SERVER["REQUEST_URI"], "com_dtregister") === false) && (strpos($_SERVER["REQUEST_URI"], "com_dtdonate") === false))     {  	   if ($_SERVER['SERVER_PORT'] == 443)  	   {  	   	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.

[SOLVED] https and http 15 years 8 months ago #2263

  • cjmicro
  • cjmicro's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0
I tried this and was getting parse errors, then realized I had to change the code where it shows && to use the real ampersand. May seem obvious to some, but not me at first :unsure:

Thanks for the code, I hope to add some other components as well to make the site function better.

Cheryl

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

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