views:

34

answers:

1

Hello,

I'm working on a multi-language website and I'm having a little trouble with rewriting URLs.

So lets say I want to rewrite URLs for the products page. I must have something like this:

http://www.mywebsite.com/products/some-product-name-34.html (for english)

http://www.mywebsite.com/produits/some-product-name-34.html (for french)

There will also be some static pages like a privacy policy page. I must have something like this:

http://www.mywebsite.com/privacy-policy.html (for english)

http://www.mywebsite.com/politique-de-confidentialite.html (for french)

Any ideea how I can accomplish this? Thanks.

A: 

This one would make the products accessible under its two names:

RewriteCond /products/some-product-name-34.html
RewriteRule /products/some-product-name-34.html /produits/some-product-name-34.html

That you have to do for all other files as well. Or if its just the directory, you like to rename

RewriteCond /products/(.*)$
RewriteRule /products/(.*)$ /produits/$1

would do.

JochenJung
@JochenJung, I don't think this is ok because I can't enter the word (products, produits) in there. I need a placeholder for that word.
Psyche