4

I have Joomla site with native language system and my site looks like this:

  • www.mydomain.pl
  • www.mydomain.pl/en/
  • www.mydomain.pl/de/
  • www.mydomain.pl/se/
  • www.mydomain.pl/dk/

I have domain www.mydomain.se and www.mydomain.dk

How can I rewrite my links as:

  • www.mydomain.pl/se/ to www.mydomain.se
  • www.mydomain.pl/dk/ to www.mydomain.dk

Thanks in advance.

  • 1
    It's common for people who are new to the site to ask questions and then never accept an answer. As a result, their newer questions tend to be ignored. Reputation points are the currency of this site, and accepting an answer is like tipping a waiter/waitress :-) please valid an anwser if it was resolving your question – Pierre-André Vullioud Mar 17 '16 at 16:40
  • 1
    I am not quite new user, in Stack Overflow have a little bit more reputation and badges ;) I just have not enough time to try it. If it will resolve my problem, of course I would choose the answer – noiragneau Mar 18 '16 at 13:30
4

There is a nice free plugin Language Domains from Yireo, which allows you to switch the domain-name as soon as a specific language is selected.

Each domain is bound to a language, by configuring the plugin parameters. Once enabled, the plugin detects the current domain name, checks the current language, and redirects to a new domain if needed.

You can configure the domain-bindings within the plugin parameters, such as:

en-GB=example.co.uk
fr-FR=example.fr
de-DE=example.de
nl-NL=example.nl

  • Thanks! I tried few plugins but all them worked wrong in some way. Do you know how to configure the rest? Example, when I am on www.mydomain.pl, the rest is like www.mydomain.pl/en/. When I enter www.mydomain.se, other versions are like www.mydomain.se/en/ – noiragneau Mar 21 '16 at 9:09
  • OK, I have just noticed that PL, SE, DK work fine but the rest not. Associations are ok but all links lose the language ID. When the plugin is enabled, links in menu looks like www.mydomain.pl/nextsite/ instead www.mydomain.pl/cz/nextsite/ – noiragneau Mar 21 '16 at 9:47
  • Well... I have used this plugin more than three years ago on J2.5 site, and it worked flawlessly but with just two language domains. Haven't had a need for it recently on J3 sites. Why don't you ask developers for some help? Yireo is pretty respectable name in Joomlaverse, I'm certain they will help you. – Mikan Mar 21 '16 at 10:04
  • it is no more supported :( – kokbira Jun 11 '18 at 14:22
2

Try adding the following to your .htaccess file.

RewriteEngine on
RewriteRule ^se(.*)$ http://www.mydomain.se$1 [R=301,L]
RewriteRule ^dk(.*)$ http://www.mydomain.dk$1 [R=301,L]

If you only have a htaccess.txt file, please rename it to .htaccess

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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