Forum Archive - Spanish URLs

Spanish URLs
Aug 31, 2013 2:31 pm by YaegerDesign
Take a look at the links in the Spanish site: http://semyx.com/es/ Notice they are all in Spanish. We have this manual translation running alongside the GTranslate for other languages. I have been able to write redirects for the Spanish URLs so that language switcher knows what is the correct URL: RewriteBase /es/ RewriteRule ^company.html$ empresa.html? [R=301] However, if you go to the Spanish site and then try to go to any other language, GTranslate tries to translate the Spanish URL from English: http://semyx.com/da/empresa.html I've tried to write redirects for those Spanish pages back to the English URLs, but I get the 301 Moved Permanently page for every URL: moved-permanently-error-t3183.html
Re: Spanish URLs
Sep 2, 2013 10:10 am by Yana
Hi, The URL translation feature is available only in GTranslate enterprise version. You can try to enable follow_location option in the gtranslate/config.php file. Hope this will help you.
Re: Spanish URLs
Sep 4, 2013 9:44 pm by YaegerDesign
I am not doing URL translation via GTranslate. That was done in our manual translation in Spanish. I have the following snippet of code in the .htaccess file of the /es/ sub-folder: # English -> Spanish redirects RewriteBase /es/ RewriteCond %{HTTP_HOST} ^.*$ RewriteRule ^company.html$ empresa.html? [R=301,L] RewriteRule ^products.html$ productos.html? [R=301,L] # etc... This works well at making sure the translation widget pulls up the correct Spanish page (actual files on the server). However, if using the widget to switch from the Spanish pages to another language, I need to make sure the English URLs are used for translation instead of the Spanish URLs. Thus, I have the following code in the .htaccess file of the root directory: # Spanish -> English redirects RewriteCond %{REQUEST_URI} !^/es RewriteRule ^empresa.html$ company.html? [R=301,L] RewriteRule ^productos.html$ products.html? [R=301,L] # etc... The problem is that I am getting an infinite redirect loop when visiting any of the Spanish URLs. If I remove the ES->EN redirects in the root, everything in the /es/ dir works fine. However, I can't seem to get the rewrites of the URLs in the root directory from Spanish -> English. I want to make sure the Spanish URLs are only showing in the ES folder and root and every other (virtual) folder uses the English URLs. I should note that the ES->EN rewrites are above the GTranslate rewrites, though I have tried both ways.
Re: Spanish URLs
Sep 10, 2013 4:46 pm by YaegerDesign
Any suggestions?
Re: Spanish URLs
Sep 11, 2013 10:40 am by Edvard
Hi, Please try to add the rewrite rules below before #gtranslate config block. RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/empresa.html$ /$1/company.html [R=301,QSA,L] etc... So when you access to /da/empresa.html it will first redirect to /da/company.html then translate it. Hope that makes sense. Thank you!
Re: Spanish URLs
Sep 12, 2013 6:20 am by YaegerDesign
That makes sense, but I need to exclude the /es/ folder. I think that is what is causing the redirect loop. /es/empresa.html is correct. /da/empresa.html should redirect.
Re: Spanish URLs
Sep 12, 2013 11:09 am by Yana
Hi, You can try replace [a-z]{2}|zh-CN|zh-TW with the language codes which you want to use . for example fr|de|ru|xh-CN|zh-TW
Re: Spanish URLs
Sep 12, 2013 8:01 pm by YaegerDesign
Do you have a full list of all available languages? Would I need to update this every time a new language is added, or our current version will never get any more languages? Also, wouldn't it be easier to just specify the languages NOT to be included instead of all that are? Or, is that not possible?
Re: Spanish URLs
Sep 13, 2013 8:11 am by Yana
Hi, Here are the language codes: af - Afrikaans, sq - Albanian, ar - Arabic, hy - Armenian, az - Azerbaijani, eu - Basque, be - Belarusian, bg - Bulgarian, ca - Catalan, zh - CN - Chinese - (Simplified), zh - TW - Chinese - (Traditional), hr - Croatian, cs - Czech, da - Danish, nl - Dutch, en - English, et - Estonian, tl - Filipino, fi - Finnish, fr - French, gl - Galician, ka - Georgian, de - German, el - Greek, ht - Haitian - Creole, iw - Hebrew, hi - Hindi, hu - Hungarian, is - Icelandic, id - Indonesian, ga - Irish, it - Italian, ja - Japanese, ko - Korean, lv - Latvian, lt - Lithuanian, mk - Macedonian, ms - Malay, mt - Maltese, no - Norwegian, fa - Persian, pl - Polish, pt - Portuguese, ro - Romanian, ru - Russian, sr - Serbian, sk - Slovak, sl - Slovenian, es - Spanish, sw - Swahili, th - Thai, tr - Turkish, uk - Ukrainian, ur - Urdu, vi - Vietnamese, cy - Welsh, yi - Yiddish
Re: Spanish URLs
Sep 13, 2013 3:24 pm by YaegerDesign
Would I need to update this every time a new language is added, or our current version will never get any more languages? Also, wouldn't it be easier to just specify the languages NOT to be included instead of all that are? Or, is that not possible?

SIMILAR TOPICS

Enterprise URLs not workingMay 14, 2018 8:25 pmReplies: 1Post by: dpitfield
Some bad URLs and high load on website - bad config?Aug 11, 2017 9:18 pmReplies: 3Post by: Ant_Z
Post urls not translated if switch to different languageAug 2, 2017 9:24 amReplies: 4Post by: merovatis
Language always resets to Spanish on mobileFeb 25, 2017 4:37 amReplies: 1Post by: KeThomas91
Blank page with sub-directory URLsFeb 25, 2017 4:38 pmReplies: 1Post by: blim

Try GTranslate with a free 15 day trial