Specific languages only in htaccess
Apr 8, 2011 1:47 pm by daniellima
Apr 8, 2011 1:47 pm by daniellima
Hello
I want to restrict only feels languages to be translated and access, in .htaccess.
For example, only fr,en,uk and sw:
If I change
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)/(.*)$ /$1/$3 [R=301,L]
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)$ /$1/ [R=301,L]
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ .............................
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ ...................
To
RewriteRule ^(fr|en|uk|sw)/(fr|en|uk|sw)/(.*)$ /$1/$3 [R=301,L]
RewriteRule ^(fr|en|uk|sw)/(fr|en|uk|sw)$ /$1/ [R=301,L]
RewriteRule ^(fr|en|uk|sw)/(.*)$ .............................
RewriteRule ^(fr|en|uk|sw)$ ...................
Is it correct?
I dont understand why in this line
([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)
repeat "([a-z]{2}|zh-CN|zh-TW)" two times?
Thanks
Re: Specific languages only in htaccess
Apr 8, 2011 3:46 pm by Edvard
Apr 8, 2011 3:46 pm by Edvard
Yes it is correct.
SIMILAR TOPICS
Translate website to any specific language, on page load | Jan 19, 2019 6:49 am | Replies: 1 | Post by: Leaon7756 |
How do I add Indian languages in Drupal GTranslate? | Sep 18, 2011 6:10 am | Replies: 26 | Post by: rag_gupta |
Code to use in Google Analytics to track languages | Nov 16, 2015 10:46 am | Replies: 9 | Post by: lucysadler |
Different languages - different banners | Mar 27, 2018 11:20 am | Replies: 3 | Post by: samdo |
What happens if site already has two or more languages ? | Sep 14, 2017 5:54 am | Replies: 7 | Post by: Sarge2017 |