knitting

Author Topic: Back to HTTP Redirect Plugin  (Read 906 times)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 9444
Back to HTTP Redirect Plugin
« on: June 05, 2012, 13:15:03 PM »
This plugin will redirect product details & category pages back to HTTP if your are in https.

J2.5++ ONLY
Download Here

http://www.kaizenmediaworks.com/virtuemart-2-0-redirect-back-to-http-plugin

GUYS: the plugin is having a problem when using SEF urls.

To redirect back to http

You can place this code in your category and product details template


/* Back to http */
   $currentcheck = JURI::current();
         $comparethis = str_replace( 'https:', 'http:', $currentcheck );
      if ($comparethis !== $currentcheck){
       $app = JFactory::getApplication();
 $app->redirect($comparethis, null, null, true, true);
       }   
"Banquet Tables Pro"
I do NOT do development work for hire.
My Custom Field Plugin Now with =Price
http://forum.virtuemart.net/index.php?topic=99678
My Shipping Plugin
http://forum.virtuemart.net/index.php?topic=100630.0

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 9444
Re: Back to HTTP Redirect Plugin
« Reply #1 on: June 15, 2012, 06:45:11 AM »
guys has anyone tested this?

is it working? with and without SEF?
"Banquet Tables Pro"
I do NOT do development work for hire.
My Custom Field Plugin Now with =Price
http://forum.virtuemart.net/index.php?topic=99678
My Shipping Plugin
http://forum.virtuemart.net/index.php?topic=100630.0

Dokho

  • Beginner
  • *
  • Posts: 17
Re: Back to HTTP Redirect Plugin
« Reply #2 on: June 18, 2012, 15:47:35 PM »

It works without SFE. 

Thanks, I was looking a urgent solution.

Stonedfury

  • Jr. Member
  • **
  • Posts: 181
    • Pollen Ranch
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.20b
Re: Back to HTTP Redirect Plugin
« Reply #3 on: April 22, 2013, 14:18:23 PM »
can we check to see if the site is loading the cart and if not then redirect all to http?
if the link = index.php?option=com_virtuemart&view=cart then https if not then http

I ask because as it is the code would work on pages it is inserted but what if used in main index.php of template. Would it override the one that switches to https? I have code in place that puts the cart into https regardless of any settings.

on default cart page /template/mine/html/com_virtuemart/cart/default.php
Code: [Select]
   $currentcheck = JURI::current();
         $comparethis = str_replace( 'http:', 'https:', $currentcheck );
      if ($comparethis !== $currentcheck){
       $app = JFactory::getApplication();
 $app->redirect($comparethis, null, null, true, true);
       }
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.
I try to keep current versions installed. So atm JM2.5.11 VM 2.0.20b PHP 5.3 MySQL Apache

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 9444
Re: Back to HTTP Redirect Plugin
« Reply #4 on: April 22, 2013, 14:30:05 PM »
I do this with cart & user pages.
To make sure its ssl, to pass PCI testing



<?php
// make sure its HTTPS
$uri = & JFactory::getURI();
   $currentcheck=JURI::current();
         $comparethis = str_replace( 'http:', 'https:', $currentcheck );
      if ($comparethis !== $currentcheck){
       $app = JFactory::getApplication();
 $app->redirect($comparethis, null, null, true, true);
       }
       ?>
"Banquet Tables Pro"
I do NOT do development work for hire.
My Custom Field Plugin Now with =Price
http://forum.virtuemart.net/index.php?topic=99678
My Shipping Plugin
http://forum.virtuemart.net/index.php?topic=100630.0

Stonedfury

  • Jr. Member
  • **
  • Posts: 181
    • Pollen Ranch
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.20b
Re: Back to HTTP Redirect Plugin
« Reply #5 on: April 23, 2013, 09:39:59 AM »
I downloaded the plugin and turned it on. I did not get any errors but it did not change the http to https. However I was wondering. You are doing a check to see what the view is. Can that be adjusted to check the links? Say for address, billing, cart, etc.,?
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.
I try to keep current versions installed. So atm JM2.5.11 VM 2.0.20b PHP 5.3 MySQL Apache

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 9444
Re: Back to HTTP Redirect Plugin
« Reply #6 on: April 23, 2013, 10:08:00 AM »
the plugin will not work with sef urls.

just use the code I posted in whatever template you want it in.

"Banquet Tables Pro"
I do NOT do development work for hire.
My Custom Field Plugin Now with =Price
http://forum.virtuemart.net/index.php?topic=99678
My Shipping Plugin
http://forum.virtuemart.net/index.php?topic=100630.0

VirtueMart Forum

Re: Back to HTTP Redirect Plugin
« Reply #6 on: April 23, 2013, 10:08:00 AM »