Installing GTranslate for a subdirectory Joomla installation

Popular automatic website translation tool

Installing GTranslate for a subdirectory Joomla installation

Postby Tllrrb5 » Tue Aug 27, 2013 7:58 pm

Hello, I have an old Joomla site let's say, (just a sample)

I am currently developing a new version of it with the latest Joomla in a subdirectory

I tried to install GTranslate PRO in the new site and the GTranslate Free module and configured on the fly translation. Now when I click the flag icon, the url goes to

I've discovered that for subdirectory installations, I should use the instruction for the general version. I followed the instructions there and installed the gtranslate in the root. It becomes worse, the translation is not working. I expected that because the following htaccess rules provided:

# 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]

seems not to make sense to me (I know htaccess).

Because of that, I tried installing the general gtranslate within /newsite/ subdirectory. I tried to check and
then I fixed the htaccess myself:

RewriteBase /newsite

# 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=newsite/$2 [L,QSA]
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ gtranslate/translate.php?lang=newsite/$1 [L,QSA]

After that it worked! However, I have another issue, the menu urls are still redirecting to this pattern: I'm wondering why it's redirecting to that. That page is a "no page found". The pattern is already working.

Another issue is that it's affecting JSN Slideshow photo slide url. Instead of ... w/boys.png it becomes ... w/boys.png

Can you please help me on this?
Posts: 4
Joined: Tue Aug 27, 2013 1:27 pm

Re: Installing GTranslate for a subdirectory Joomla installa

Postby Yana » Wed Aug 28, 2013 1:42 am


If your website is in the subdirectory, you should use GTranslate Pro general version. The language code should be after the domain name not after the subfolder.
You should add the redirect rules after RewriteEngine On and GTranslate should be in the root directory.
As to the Slideshow photo , you can add rule in your .htaccess file to redirect images to the default language.
Here is an example:
RewriteRule ^([a-z]{2})/newsite/images/imageshow/(.*) /newsite/images/imageshow/$2 [R=301,L]

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Posts: 4090
Joined: Thu Jan 12, 2012 6:21 pm

  • Related Topics
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests