Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Is it possible to configure a...
Is it possible to configure a redirect for certains URLs
Is it possible to configure a redirect for certains URLs
Hi,
I have no experience with PHP, but I can't find any information for my problem. Now can someone tell me if I can solve my problem with MetaMod?
I use Joomla 3.0 with MetaMod 3.13b. My site is in 3 languages (german, english and spanish) and reachable over 3 domains (miami-playa.ch, apartments-costa-dorada.com and apartamentos-costa-dorada.es).
I would like to create follwoing redirections based on the introduced domain:
1. miami-playa.ch redirect to http://www.miami-playa.ch/index.php?lang=de
2. apartments-costa-dorada.com redirect to http://www.apartments-costa-dorada.com/ … hp?lang=en
3. apartamentos-costa-dorada.es redirect to http://www.apartamentos-costa-dorada.es … hp?lang=es
At the moment my website has the german language as default language for all Domains. Is it possible to change that behavior? so that each domain have a default langauge. For example when I introduce apartamentos-costa-dorada.es on google, I see the website description in German (default language). Is it possible to assign the spanish language to the domain?
Thanks a lot in advance for your help.
Re: Is it possible to configure a redirect for certains URLs
Very nice extension. I have seen and configured now the language detection in the modul, it works fine.
If I would like now to make a redirection for countries, can I use GeoIP and following PHP code?
***
// GeoIP example.
// This page is only for New Zealand viewers, kick Australians onto specific page and
// all other countries onto an international pricing page.
$app = &JFactory::getApplication();
if ( $fromCountryId == "DE" )
$app->redirect("http://www.miami-playa.ch/index.php?lang=de");
else if ( $fromCountryId != "GB" )
$app->redirect("http://www.apartments-costa-dorada.com/ … hp?lang=en ");
else if ( $fromCountryId != "ES" )
$app->redirect("http://www.apartamentos-costa-dorada.es … hp?lang=es ");
***
If that works I will buy the pro version.
Re: Is it possible to configure a redirect for certains URLs
Hi Rob,
WHen doing redirection for countries in this way, you need to be quite careful about the logic. In your logic above, people from Germany get redirected to the 1st place, then everyone apart from GB gets redirected to the second, then GB gets redirected to the 3rd (because it's the only country left that didn't get redirected by the 1st two).
So what countries do you actually want to be redirected to which domains?
Also, I should mention that MetaMod (or Pro) is not really the best option for dealing with domains and redirection. Chameleon would be a lot easier to configure, and doesn't try to do it by displaying modules-that-aren't-really-modules. MetaMod is great for determining which module to display, but Chameleon is great at setting page language, dealing with different domains, detecting GeoIP, and doing redirections. With Chameleon you can probably avoid using PHP altogether. And there's a 30 day money back guarantee!
Best regards,
Stephen
Re: Is it possible to configure a redirect for certains URLs
Hi Stephen
Thank you for your reply. I noticed yesterday that my php code above don't work like I want. I had to deactivate it.
I will try Chameleon in the next days, thank you for the hint.
Finally I would like to achive following:
- If a visitor comes with from Spain or with a spanish browser, then he should be redirected to the domain www.apartamentos-costa-dorada.es and spanish language.
- If a visitor comes from GB or with an english browser, then he should be redirected to the domain www.apartments-costa-dorada.com and english language.
- And finally when a visitor comes from Germany, Switzerland or Austria, he should be redirected to the domain www.miami-playa.ch and german language.
I tried already another extension and the PHP code with metamod. Both solutions are not usable, because I receive some strange messages in the Browser that there are to many redirections. I think that there is a problem with the cookies as the URLs don't match.
Now I will try it with chameleon. Perhaps I am trying something that will not work how I would like. I will see.
Thank you.
Re: Is it possible to configure a redirect for certains URLs
To do this in Chameleon I would set up 6 rules:
Rule 1: detect country ES, browser language ES, and domain www.apartments-costa-dorada.com or www.miami-playa.ch. (i.e. people in spain with spanish browser and on one of the "wrong" domains).
In the succeed action, redirect to www.apartamentos-costa-dorada.es/es (i.e. the /es on the end forces the spanish language).
What this doesn't do: if the person is in spain and browser is in ES, and they are actually on the right domain (www.apartamentos-costa-dorada.es) then it won't redirect them or set the language to ES.
So if you want everyone from spain with browser ES to get the site in Spanish, then make a second rule:
Rule 2: detect country ES, browser language ES and domain www.apartamentos-costa-dorada.es.
succeed action: set the language to ES.
Then repeat rule 1, or rules 1&2 for the other domains.
Hope that helps,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Is it possible to configure a...
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:
- 161
- 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