Page 1 of 1

Apache htaccess: rewrite url in different languages

Posted: Tue Jun 23, 2009 4:21 am
by knalstaaf
Is it possible to rewrite an url in different languages, so that you don't have to make separate folders or database tables with in a specific language?

Example:

This is a htaccess-rewritten url:

www.domain.com/animals/cats (originally http://www.domain.com/page.php?cat=animals&species=cats)

Let's say you want to put this url in french (for french visitors or search engine algorithms)

www.domain.com/animaux/chats

Is this possible the rename the french url without altering the original (english) url (being http://www.domain.com/page.php?cat=animals&species=cats)?

Thanks in advance.

Re: Apache htaccess: rewrite url in different languages

Posted: Tue Jun 23, 2009 3:55 pm
by patrickmvi
What you should do is create aliases in your DB for your category names. Then in your page.php script you could look up categories first by their actual name, then if nothing is found, search for any aliases and then the aliases would tell your script that it's supposed to go to animals instead of animaux.