2

I wonder if anyone can help me with this redirect problem...

Here's the 'Tutorials' section of my site: http://www.schoolofsugarcraft.annpickardsugarcraft.com/index.php?option=com_content&view=category&layout=blog&id=10&Itemid=103

As you can see, I am displaying the intro text (Show Unauthorized Links in the Category blog) to unregistered users so that they can be tempted to sign up.

If you already have a login, and login on the page (rather than using the module in the right column) the path of the returning page is totally wrong. Meaning that the Page Title is wrong and I can't control the modules that are displayed.

You can try it by using Leila / leilah to login. Try logging in through the module vs logging in on the actual page.

I have tried creating a hidden menu item for a Login page and setting a redirect there but it doesn't seem to have any effect. Is there some problem with the unauthorized links option?

Is there any other way to force the returning page to have the correct URL and all the good things that go with it (correct breadcrumbs, active menu item, active modules etc!)?

The Joomla version is 3.3.6 BTW.

Many thanks

1 Answer 1

2

There seems to be a problem with the generated redirect URL.

Example:
When using the login module to log in, the URL for the article "Traditional round nosed bear" is this:

index.php?option=com_content&view=article&id=10:traditional-round-nosed-bear&catid=23&Itemid=103

However, when using the "Login or Subscribe to read more..." button to log in, the url for the same article is:

index.php?option=com_content&view=article&id=10:traditional-round-nosed-bear&catid=23&Itemid=103

(note four occurences of & in the second URL.) That's why you're unable to control modules and page title on the page.

I couldn't reproduce your problem, but here's a couple of ideas:

Try enabling "Search Engine Friendly URLs" (in Global configuration) and see if that solves the problem.

Search Engine Friendly URLs

If that doesn't work, please check if the following file exists in your template directory:

/templates/YOURTEMPLATE/html/com_content/category/blog_item.php

If it does, it might contain an erroneous redirect. Look for something similar to

  $link->setVar('return', base64_encode(urlencode($returnURL)));

and change it to

$link->setVar('return', base64_encode($returnURL));
2
  • Oh god. I am a complete idiot. I have just seen that the SEO friendly URLs were switched off and now it works perfectly. I appreciate your time and am so sorry that I didn't find this error myself.
    – LeilaH
    Commented Oct 2, 2014 at 15:58
  • No problem, I'm glad I could help.
    – johanpw
    Commented Oct 2, 2014 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.