0

I have several languages on my site.

At the root I have a index.php. It's my homepage.

I want this type of url : domain.com/fr/ or domain.com/en/

Witch must be the same as domain.com/index.php?lang=fr or domain.com/index.php?lang=en.

So I use this .htaccess rule:

# Redirect to a page (xxxxx.com/index.php?lang=fr)
RewriteRule ^(fr|en|es|cn|ar)/index$  index.php?lang=$1 [L]

But it don't work.

Could you please help me with that ?

Thanks.

1 Answers1

0

You can use:

RewriteEngine On
RewriteRule ^(fr|en|es|cn|ar)/$  index.php?lang=$1 [L]
Pedro Lobito
  • 94,083
  • 31
  • 258
  • 268
  • And if I want a default language ? –  May 12 '16 at 02:43
  • Take a look at http://stackoverflow.com/questions/8133094/rewriterule-for-htaccess-to-hide-default-language or here http://stackoverflow.com/questions/16854820/htaccess-rule-for-language-detection – Pedro Lobito May 12 '16 at 02:44