Forum Archive - Removing some languages from caching (pro version)

Removing some languages from caching (pro version)
Dec 17, 2014 1:20 pm by pr1970
Hi I have the following list of languages from my sitemap that i`d only like translated in the cache folders , as i have some 3500 pages in each cache folder. Can you explain what I need to change in the .htaccess file to only allow the following to be cached? Thanks alot. http://www.####.com/en/ http://www.####.com/ar/ http://www.####.com/hy/ http://www.####.com/eu/ http://www.####.com/bg/ http://www.####.com/zh-CN/ http://www.####.com/zh-TW/ http://www.####.com/hr/ http://www.####.com/cs/ http://www.####.com/da/ http://www.####.com/nl/ http://www.####.com/tl/ http://www.####.com/fi/ http://www.####.com/fr/ http://www.####.com/ka/ http://www.####.com/de/ http://www.####.com/el/ http://www.####.com/iw/ http://www.####.com/hu/ http://www.####.com/id/ http://www.####.com/it/ http://www.####.com/ja/ http://www.####.com/ko/ http://www.####.com/lv/ http://www.####.com/no/ http://www.####.com/fa/ http://www.####.com/pl/ http://www.####.com/pt/ http://www.####.com/ro/ http://www.####.com/ru/ http://www.####.com/sr/ http://www.####.com/sk/ http://www.####.com/sl/ http://www.####.com/es/ http://www.####.com/sv/ http://www.####.com/th/ http://www.####.com/tr/ http://www.####.com/uk/ http://www.####.com/vi/ From my .htaccess file # gtranslate config 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] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA] RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA]
Re: Removing some languages from caching (pro version)
Dec 17, 2014 2:32 pm by Yana
Hi, You can replace [a-z]{2}|zh-CN|zh-TW with the language codes which you want to use. # gtranslate config RewriteRule ^(en|ar|hy|eu|bg|zh-CN|zh-TW|hr|cs|da|nl|tl|fi|fr|ka|de|el|iw|hu|id|it|ja|ko|lv|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sv|th|tr|uk|vi)/(en|ar|hy|eu|bg|zh-CN|zh-TW|hr|cs|da|nl|tl|fi|fr|ka|de|el|iw|hu|id|it|ja|ko|lv|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sv|th|tr|uk|vi)/(.*)$ /$1/$3 [R=301,L] RewriteRule ^(en|ar|hy|eu|bg|zh-CN|zh-TW|hr|cs|da|nl|tl|fi|fr|ka|de|el|iw|hu|id|it|ja|ko|lv|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sv|th|tr|uk|vi)/(en|ar|hy|eu|bg|zh-CN|zh-TW|hr|cs|da|nl|tl|fi|fr|ka|de|el|iw|hu|id|it|ja|ko|lv|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sv|th|tr|uk|vi)$ /$1/ [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(en|ar|hy|eu|bg|zh-CN|zh-TW|hr|cs|da|nl|tl|fi|fr|ka|de|el|iw|hu|id|it|ja|ko|lv|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sv|th|tr|uk|vi)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA] RewriteRule ^(en|ar|hy|eu|bg|zh-CN|zh-TW|hr|cs|da|nl|tl|fi|fr|ka|de|el|iw|hu|id|it|ja|ko|lv|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sv|th|tr|uk|vi)$ /gtranslate/translate.php?lang=$1
Re: Removing some languages from caching (pro version)
Dec 17, 2014 2:53 pm by pr1970
Thats great, i`ll give it a try. Thank you
Re: Removing some languages from caching (pro version)
Dec 17, 2014 7:58 pm by Yana
You are welcome!

SIMILAR TOPICS

How do I add Indian languages in Drupal GTranslate?Sep 18, 2011 6:10 amReplies: 26Post by: rag_gupta
Code to use in Google Analytics to track languagesNov 16, 2015 10:46 amReplies: 9Post by: lucysadler
Caching and gTranslateMay 3, 2018 2:08 pmReplies: 1Post by: challisc
Different languages - different bannersMar 27, 2018 11:20 amReplies: 3Post by: samdo
Googlebot seeing desktop version of site instead of mobilelMar 16, 2018 3:06 amReplies: 5Post by: natastna2

Try GTranslate with a free 15 day trial