Redirect to new language prefix in multilingual si
-
dc006
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 2
-
Thank you received: 0
-
-
10 years 4 months ago #3376
by dc006
Hello,
Iam running multilingual Joomla web site with 3 languages.
My site was configured not to use language prefix for default language.
I've decide to change this and use language prefix for my default language now.
An example of my current URLs looks like this:
default:: mysite.com/forum
english:: mysite.com/en/forum
slovak:: mysite.com/sk/forum
And I would like to have URLs like this:
default:: mysite.com/cz/forum
english:: mysite.com/en/forum
slovak:: mysite.com/sk/forum
Iam struggling to figure out how to set-up a 301 redirect for default language.
I can not obviously redirect all request after trailing slash, because it would redirect everything.
Is it possible to use reDJ and create 1 rule to achieve my goal?
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
10 years 4 months ago #3378
by admin
Not tested but try this:
From URL: ^/
To URL: {scheme}://{siteurl}/cz{path}{queryfull}
Skip: ^/(cz|en|sk)/
Request only: true (checked)
The trick is the skip condition that will skip any URL with the language code already set.
Kind regards,
Luigi
Please Log in or Create an account to join the conversation.
-
dc006
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 2
-
Thank you received: 0
-
-
10 years 4 months ago #3380
by dc006
Hi, this rewrite gives me an infinitive loop
mysite.com/cz/cz/cz/....
thank you
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
10 years 4 months ago #3382
by admin
Sorry,
I forgot that "Skip" refers to the whole URL. Try this:
From URL: ^/
To URL: {scheme}://{siteurl}/cz{path}{queryfull}
Skip: /(cz|en|sk)/
Request only: true (checked)
Please Log in or Create an account to join the conversation.
Time to create page: 0.142 seconds