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

tmdonovan

I didn't use the Back to HTTP Redirect plugin described in the first post of this thread.  I am an experienced programmer, so I followed the instructions to manually override the joomla template, then modified the productdetails and category default.php files directly to handle the "back to HTTP" function, as described by PRO on June 10, 2013 at 11:19:13. 

The first post has the link to download the plugin, and I will have to defer to PRO's expertise with respect to its use.

RevoLion

I prefer programming, instead of plugin. Thank you so much for your clarity on this.

Jeremy

PRO

the "plugin" will not work with SEF urls, BECAUSE   system plugins run BEFORE JRoute (which is what makes the urls)

SO:  when you put the code in  your VIRTUEMART template override files,it will work with SEF urls.

so for example

views/tmpl/productdetails/default.php

HERE.

BUT!

Do a template  override
http://forum.virtuemart.net/index.php?topic=90935.0


Stonedfury

#18
Would it be possible to just do <?php 
$view 
JRequest::getVar('view'); // checks to see what view you are on EX: category
if ($view == 'TheViewYouwant') { 
/*check to see if https if not make https */
$currentcheck JURI::current();
$comparethis str_replace'http:''https:'$currentcheck );
if (
$comparethis !== $currentcheck){
$app JFactory::getApplication();
$app->redirect($comparethisnullnulltruetrue);

} else {

/* check if http and if not set to http */
$currentcheck JURI::current();
$comparethis str_replace'https:''http:'$currentcheck );
if (
$comparethis !== $currentcheck){
$app JFactory::getApplication();
$app->redirect($comparethisnullnulltruetrue);
}
}
?>

It does not really require anything other than the view. Possibly use or to add more views into the list? What you think Pro?

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

Quote from: Stonedfury on June 11, 2013, 23:27:11 PM
Would it be possible to just do <?php 
$view 
JRequest::getVar('view'); // checks to see what view you are on EX: category
if ($view == 'TheViewYouwant') { 
/*check to see if https if not make https */
$currentcheck JURI::current();
$comparethis str_replace'http:''https:'$currentcheck );
if (
$comparethis !== $currentcheck){
$app JFactory::getApplication();
$app->redirect($comparethisnullnulltruetrue);

} else {

/* check if http and if not set to http */
$currentcheck JURI::current();
$comparethis str_replace'https:''http:'$currentcheck );
if (
$comparethis !== $currentcheck){
$app JFactory::getApplication();
$app->redirect($comparethisnullnulltruetrue);
}
}
?>

It does not really require anything other than the view. Possibly use or to add more views into the list? What you think Pro?



where would you put this?

it cant be a plugin because system plugins dont know the "view" unless its actually in the url.

you could do something like this in your joomla template though if you want.

you can use the code however you want.

But I use mine just like I posted before,
I use it in specific templates etc. to->https   or back to->http

I also use it in my content templates




Stonedfury

Maybe the index.php. It was a thought.
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.

volksman3

Hi All,

Been having the SSL issues people have mentioned here and i found this worked for me http://extensions.joomla.org/extensions/site-management/url-redirection/11326 allows redirection to SSL and back to SSL for selected pages, works with SEF URLs and VM2.

Parachutes are like minds, they only work when they are open!
http://www.akirastudio.co.uk

trumples

This is a great plugin for redirects, thanks for coming across it.