How to emulate subdomain/language in .htacces file
Aug 23, 2018 8:40 am by ramyrickson
Aug 23, 2018 8:40 am by ramyrickson
first of all let me tell you guys i had posted this on stack overflow i dint get an appropriate answer hope you guys can answer me I have been looking at some way to implement the language subdomain behavior of the enterprise version of GTranslate and have come close.
Basically, if you want subdomains like fr.domain.com, es.domain.com, de.domain.com, etc for the PRO version (general implementation), then there should be a way to handle this with modifications in the .htaccess file.
This isn't quite right, but it's coming close - for example, if you wanted "de.domain.com" for German, there might be a modification like:
RewriteCond %{THE_REQUEST} !^[A-Z]+\ /gtranslate/
RewriteRule ^(.*)$ target="_blank [NC,L,R=301]
The Condition is to prevent recursion... This seems to come close, but the problem is that the URL in the browser now shows de.domain.com/gtranslate/translate.php?lang=de&url=about.html instead of the desired de.domain.com/about.html
There must be a way to handle this so that we can emulate this behavior.
Motivation: Perhaps I should have stated this up top.
I'm using the general version with Joomla - seems to work most of the time, BUT it looses the language during a form submission because the redirection (POST?) of the form looses the language code (normally a 2-letter prefix to the URL.
If I was able to keep a language per subdomain, then it seems like I would be able to properly keep the language during a form submission (as well as the potential "niceness" of having a subdomain to reflect the language - could even be the name of the country).
Anyone who is better in mod_rewrite want to take a stab at this?
Re: How to emulate subdomain/language in .htacces file
Aug 23, 2018 9:25 am by Edvard
Aug 23, 2018 9:25 am by Edvard
Hi,
As I understand you are using our old Pro version: https://gtranslate.io/blog/end-of-life- ... nslate-pro
You will need to upgrade it to our new TDN service and you will be fine, there will be no need to do any changes in .htaccess file, all the translations will be on our side and you will simply point your language sub-domains to our servers on DNS level.
Thanks!
SIMILAR TOPICS
Large numbers of crawl errors with double language code | Jan 24, 2019 1:43 am | Replies: 1 | Post by: natastna2 |
Translate website to any specific language, on page load | Jan 19, 2019 6:49 am | Replies: 1 | Post by: Leaon7756 |
Graphic translation for every language is missing | Dec 19, 2018 7:54 am | Replies: 1 | Post by: Daryl Dixon |
How to remove mobile Language Select Button transparency | Dec 5, 2018 10:06 pm | Replies: 10 | Post by: JeffTR |
Change language automatically | Nov 26, 2018 9:29 pm | Replies: 3 | Post by: Antilb |