Forum Moderators: phranque
RewriteEngine on
# Language
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(.*)/_([A-Za-z]{2})/?$ /index.php?l=$2 [L]
# Sections
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(.*)$ /index.php [L]
That means:
www.mysite.com/about_us/employees/
goes to index.php
www.mysite.com/about_us/employees/_es
goes to index.php?l=es
The problem comes when i don't call any previous directories when calling a language:
www.mysite.com/_es
...it takes the second rewriteCond instead of the first one. help!
RewriteRule ^[^/]+/[^/]+/_([a-z]{2})/?$ /index.php?l=$1 [NC,L]
RewriteRule ^about_us/[^/]+/_([a-z]{2})/?$ /index.php?l=$1 [NC,L]