Help wtih subdirectory URL please

Popular automatic website translation tool

Help wtih subdirectory URL please

Postby furnivat » Sun Dec 26, 2010 7:20 pm

Hello,
I hoped you might be able to help me with a problem I have. I am using GTranslate Pro version. It is a similar problem to this post gtranslate/disable-translation-subdirectories-t21.html but slightly more complicated.

At the moment my links are, for example for French:
http://mydomain.com/fr/sub-directory/

But for one sub-directory called 'forum' I need the link to not be http://mydomain.com/fr/forum/
but instead it must be http://mydomain.com/forum/fr/

and the same format for every language.

Would you have time to tell me how I could alter the .htaccess file to set this rule (for the forum subdirectory only) please?

Thank you for your time.
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm

Re: Help wtih subdirectory URL please

Postby Edvard » Wed Dec 29, 2010 1:51 pm

You can try to add this:
Code: Select all
RewriteRule /forum/fr/ /fr/forum/ [QSA]
...
# gtranslate config
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Help wtih subdirectory URL please

Postby furnivat » Wed Dec 29, 2010 4:26 pm

Thanks for your reply, that was very nice of you. But I need to do this for all languages not just French. Is there a way to do it elegantly, without writing 51 lines (one for each language), please?
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm

Re: Help wtih subdirectory URL please

Postby Edvard » Thu Dec 30, 2010 5:27 pm

Try this instead:
Code: Select all
RewriteRule /forum/([a-z]{2})/ /$1/forum/ [QSA]
RewriteRule /forum/zh-CN/ /zh-CN/forum/ [QSA]
RewriteRule /forum/zh-TW/ /zh-TW/forum/ [QSA]
...
# gtranslate config
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Help wtih subdirectory URL please

Postby furnivat » Thu Dec 30, 2010 8:35 pm

Excellent. Many thanks, that seemed to work. Great product!
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm

Re: Help wtih subdirectory URL please

Postby furnivat » Thu Feb 24, 2011 5:55 am

I don't know what has happened because I thought before it worked after a quick test but just now when I tried to implement this properly nothing happened. Is there a checklist of things I should check? I made sure that I cleared the cache, but nothing seems to have changed. I am using this SE friendly URLs extension for Joomla 1.5: http://www.sakic.net/products/sef_advance/ Do you think I have to make any changes in the settings for that component, please?

Thanks for your help.
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm

Re: Help wtih subdirectory URL please

Postby Edvard » Thu Feb 24, 2011 2:39 pm

Access http://yourdomain.com/forum/ru/ and write here what happens.
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Help wtih subdirectory URL please

Postby furnivat » Fri Feb 25, 2011 2:00 am

Thanks for your help. It goes to http://yourdomain.com/forum/ru/ OK, just as it is supposed to
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm

Re: Help wtih subdirectory URL please

Postby Edvard » Fri Feb 25, 2011 2:04 pm

Do you see the Russian version?
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Help wtih subdirectory URL please

Postby furnivat » Fri Feb 25, 2011 2:06 pm

Yes but that is because I have another translation package for my forum.

The problem is that all the links on my Joomla menu to /ru/forum/ are not being changed to /forum/ru/
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm

Re: Help wtih subdirectory URL please

Postby Edvard » Fri Feb 25, 2011 2:19 pm

I think you are mixing something.

You need to rewrite /ru/forum/ to /forum/ru/ or vice-versa?

Currently it is set to redirect /forum/ru/ to /ru/forum/
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Help wtih subdirectory URL please

Postby furnivat » Fri Feb 25, 2011 2:32 pm

Yes exactly, I need to rewrite /ru/forum/ to /forum/ru/ !

I am sorry if I have been wasting your time here. What code would I place in the root htaccess file to rewrite /ru/forum/ to /forum/ru/ please? (and to rewrite similarly for every other language too)
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm

Re: Help wtih subdirectory URL please

Postby Edvard » Fri Feb 25, 2011 3:05 pm

This should be it:

Code: Select all
RewriteRule /([a-z]{2}|zh-CN|zh-TW)/forum/ /forum/$1/ [QSA]
...
# gtranslate config
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Help wtih subdirectory URL please

Postby furnivat » Fri Feb 25, 2011 4:01 pm

I really appreciate your help but unfortunately that didn't seem to do anything. Accessing /ru/forum/ does not direct me to /forum/ru/
Any ideas what could be wrong, please?
I tried clearing Joomla's cache and restarting my web server
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm

Re: Help wtih subdirectory URL please

Postby Edvard » Fri Feb 25, 2011 4:07 pm

Currently it should show the content of the target without the redirect. If you want it to redirect, you can use this:

Code: Select all
RewriteRule /([a-z]{2}|zh-CN|zh-TW)/forum/ /forum/$1/ [R=301,L]
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Help wtih subdirectory URL please

Postby furnivat » Fri Feb 25, 2011 4:20 pm

I think there is something fundamentally worng on my site. It seems like no changes I make in my .htaccess file have any effect (including the RewriteRule you just told me). Do you have any ideas what could be wrong? Is it to do with my SEF component in Joomla? I have another .htaccess file inside the /forum/ directory so could that be affecting this? I would not expect so, but I need to explain everything just in case.
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm

Re: Help wtih subdirectory URL please

Postby Edvard » Fri Feb 25, 2011 4:32 pm

It is hard to tell. But SEF component installed in joomla have nothing to do with .htaccess rules, if you didn't put special rules for that component in the .htaccess.

Try to write something not correct in your file and see if that gives you 500 server error, in that case you can be sure that it works.

It is also can be that the browser cached it and it doesn't send requests to the server. Try to use a different browser or make a hard refresh Ctrl+F5.
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Help wtih subdirectory URL please

Postby furnivat » Fri Feb 25, 2011 4:55 pm

I put the line "blah" in my .htaccess file and restarted the web server but I did not get a 500 server error. I read something about AllowOverRide = none cuasing this problem but that isn't in my htaccess file. Any ideas, please?
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm

Re: Help wtih subdirectory URL please

Postby furnivat » Fri Feb 25, 2011 9:26 pm

I think this is an issue with my web server's configuration. It is almost certainly nothing to do with your component so thanks very much for your help and I will resolve this on my own. Regards
furnivat
 
Posts: 24
Joined: Sun Dec 26, 2010 7:11 pm


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux