News:

Looking for documentation? Take a look on our wiki

Main Menu

Back to HTTP Redirect Plugin

Started by PRO, June 05, 2012, 21:15:03 PM

Previous topic - Next topic

PRO

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

UPDATED:::::: The search module was not working when you searched from an HTTPS page.


/* Back to http */
if (JRequest::getVar('search')!='true'){
$uri = & JFactory::getURI();
   $currentcheck=JURI::current();
         $comparethis = str_replace( 'https:', 'http:', $currentcheck );
      if ($comparethis !== $currentcheck){
       $app = JFactory::getApplication();
$app->redirect($comparethis, null, null, true, true);
       }   
       }

PRO

guys has anyone tested this?

is it working? with and without SEF?

Dokho


It works without SFE. 

Thanks, I was looking a urgent solution.

Stonedfury

#3
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/mytemplate/html/com_virtuemart/cart/default.php
   $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.

PRO

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);
       }
       ?>

Stonedfury

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.

PRO

the plugin will not work with sef urls.

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


tmdonovan

Hi, it seems like a lot of people have run into the problem of non-secure pages being set to HTTPS after visiting the first secure pages.  I appreciate that you wrote this plugin but it seems to be that this is a bug in VM2 and should be handled as such.  In addition, a plugin that doesn't work with SEF is not something I or others can use in a production site: first, we have a lot of internal links built with SEF URLs, and second, my client will not accept non-SEF URLs in a live site.  Is there any way to get this fixed as part of VM2 where it will work under all circumstances?  This is very important.

PRO

I use these codes in my templates that i want to force either ssl or non ssl


Force NON ssl

<?php
/* 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);
       }   
?>



Force SSL on pages


<?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);
       }
       ?>


tmdonovan

Where do I put this code?  And will this work with SEF?

PRO

you put the code IN WHATEVER template you need it in

http://forum.virtuemart.net/index.php?topic=90935.0


for example

on cateogry & product page. I do "back to http"

on user page, & cart page, I do "force https"


tmdonovan

Thanks for your help these changes worked for me.  And I have SEF turned on and it is working perfectly.  Your forum entry about VM 2.0 templates helped so much.

RevoLion

Quote from: PRO on June 10, 2013, 19:19:13 PM
you put the code IN WHATEVER template you need it in

http://forum.virtuemart.net/index.php?topic=90935.0


for example

on cateogry & product page. I do "back to http"

on user page, & cart page, I do "force https"



Are these to go into the main template file for the site or VM template files? Sorry just trying to get to the solved issue.

Thanks,
Jeremy

tmdonovan

You want to override the joomla template.  Follow the instructions here - http://forum.virtuemart.net/index.php?topic=90935.0

RevoLion

Thank you tmdonovan,

Do I need to download a plugin or anything for this to take affect.


Jeremy