Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

switch urls based on menu to same menu new url

switch urls based on menu to same menu new url

Hi Stephen,

I have one Joomla install with 2 urls. I am trying to figure out if there is an easy way to switch from url-A to url-B if visitor accidentally gets to the url-B menu when in url-A. I know you can do it from each menu link by using the Environment Page url equals redirect to url but you would need to set up a rule for each menu link. Is there a way for it to cover the entire menu?

Thanks,
Helen

helenbn
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: switch urls based on menu to same menu new url

Hi Helen,

Hmmm, possibly can think of a way.

I think you can get the JURI of the current URL, and just swap the host name, then redirect to it. You would put this in the PHP section in the Rule (LHS) instead of in the Actions (RHS).

Something like this:

$uri = clone(JURI::getInstance());
$uri->setHost("otherhost.com");
$app = JFactory::getApplication();
$app->redirect(JRoute::_($uri->toString()));

Obviously you need to detect all the right things before that: e.g. menu items.

Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Total Posts Today:
2
User Info:
 
Total Users:
4371
Newest User:
kajha63871
Members Online:
0
Guests Online:
183

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked