Forum Archive - Help wtih subdirectory URL please

Help wtih subdirectory URL please
Dec 26, 2010 3:20 pm by furnivat
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.
Re: Help wtih subdirectory URL please
Dec 29, 2010 9:51 am by Edvard
You can try to add this: RewriteRule /forum/fr/ /fr/forum/ [QSA] ... # gtranslate config
Re: Help wtih subdirectory URL please
Dec 29, 2010 12:26 pm by furnivat
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?
Re: Help wtih subdirectory URL please
Dec 30, 2010 1:27 pm by Edvard
Try this instead: 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
Re: Help wtih subdirectory URL please
Dec 30, 2010 4:35 pm by furnivat
Excellent. Many thanks, that seemed to work. Great product!
Re: Help wtih subdirectory URL please
Feb 24, 2011 1:55 am by furnivat
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.
Re: Help wtih subdirectory URL please
Feb 24, 2011 10:39 am by Edvard
Access http://yourdomain.com/forum/ru/ and write here what happens.
Re: Help wtih subdirectory URL please
Feb 24, 2011 10:00 pm by furnivat
Thanks for your help. It goes to http://yourdomain.com/forum/ru/ OK, just as it is supposed to
Re: Help wtih subdirectory URL please
Feb 25, 2011 10:04 am by Edvard
Do you see the Russian version?
Re: Help wtih subdirectory URL please
Feb 25, 2011 10:06 am by furnivat
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/
Re: Help wtih subdirectory URL please
Feb 25, 2011 10:19 am by Edvard
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/
Re: Help wtih subdirectory URL please
Feb 25, 2011 10:32 am by furnivat
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)
Re: Help wtih subdirectory URL please
Feb 25, 2011 11:05 am by Edvard
This should be it: RewriteRule /([a-z]{2}|zh-CN|zh-TW)/forum/ /forum/$1/ [QSA] ... # gtranslate config
Re: Help wtih subdirectory URL please
Feb 25, 2011 12:01 pm by furnivat
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
Re: Help wtih subdirectory URL please
Feb 25, 2011 12:07 pm by Edvard
Currently it should show the content of the target without the redirect. If you want it to redirect, you can use this: RewriteRule /([a-z]{2}|zh-CN|zh-TW)/forum/ /forum/$1/ [R=301,L]
Re: Help wtih subdirectory URL please
Feb 25, 2011 12:20 pm by furnivat
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.
Re: Help wtih subdirectory URL please
Feb 25, 2011 12:32 pm by Edvard
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.
Re: Help wtih subdirectory URL please
Feb 25, 2011 12:55 pm by furnivat
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?
Re: Help wtih subdirectory URL please
Feb 25, 2011 5:26 pm by furnivat
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

SIMILAR TOPICS

Joomla root is in our /en/ subdirectory (will that work?)Mar 5, 2017 3:24 amReplies: 1Post by: Rik Brown
Website in subdirectoryMar 24, 2015 12:40 pmReplies: 10Post by: SkyFocus
Probem with Subdirectory TranslationSep 8, 2016 5:43 pmReplies: 3Post by: dennyjuge
Wildcard SSL, redirect subdirectory to subdomainJun 8, 2016 7:16 pmReplies: 7Post by: coolios
Subdirectory URL structure for different languagesFeb 14, 2016 3:44 pmReplies: 3Post by: Ashiado

Try GTranslate with a free 15 day trial