Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi, I got a lot of questions today :). I have a multilingual site and want to reflect the different languages in the urls. The problem is all the file names in my language folders are named the same and there are a lot of them. for eg.:
de/kontakt.php
en/kontakt.php
fr/kontakt.php

I know it was not really smart to name them all the same, but I did not have an idea how to link them automated to each other when named differently. Anyway ...

Is it possible when pretty urls are enabled to rename the urls in the .htacces?

Code: Select all
#about.php
RewriteRule ^about$ "$0/" [R=301,L,QSA]
RewriteRule ^about/$ about.php [L,QSA]
RewriteRule ^about/.*?([^\.\/]*)\.html$ about.php?pname=$1 [L,QSA]
RewriteRule ^about/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ about.php?d=$1$2$3 [L,QSA]
RewriteRule ^about/[^\.]*?([^/\.]*)/$ about.php?fname=$1 [L,QSA]
RewriteRule ^about/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]


Thank you very much!
regards Christoph
Sorry for the delayed response, Christoph.

Replying to your query, making changes to the .htaccess file directly should theoretically work.
However, I am afraid, it won't in Couch :(

The reason is that, as a SEO measure, with prettyURLs on Couch always compares the URL used to access a template with the correct URL (as understood by Couch).
If the two differ, the visitor is redirected to the 'correct' URL.

I think this behaviour will mess up things if we manipulate the .htaccess rules.
Thank you for your answer,
is there an other option for future sites how to handle that, if I do not want to hard code any link by hand. I need something what will link automated from:

<cms:show my_lang/>/kontakt.php -> <cms:show my_lang/>/contact.php

in 4 to 5 languages.

At the moment I handle that with a php script which looks for the name of the file the user is atm. and links to the file named the same in a different folder. The folder is switched by the <cms:show my_lang/> which can be: de, it, fr, en, .... :?:
Christoph, I think we'll have to use PHP to work out the names. So, your approach seems to be just fine.
4 posts Page 1 of 1