Apache htaccess: rewrite url in different languages

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
knalstaaf
Forum Newbie
Posts: 1
Joined: Tue Jun 23, 2009 3:56 am

Apache htaccess: rewrite url in different languages

Post 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.
patrickmvi
Forum Commoner
Posts: 32
Joined: Mon Jun 22, 2009 6:45 am
Location: Fort Lauderdale, FL

Re: Apache htaccess: rewrite url in different languages

Post 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.
Post Reply