Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » switch urls based on menu to same...
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
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
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » switch urls based on menu to same...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5944
- Posts this week:
- 2
- User Info:
- Total Users:
- 7660
- Newest User:
- marino9885
- Members Online:
- 0
- Guests Online:
- 171
- 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