views:

28

answers:

2

i want an .htaccess rewrite

so /en/home pulls /home /es/stuff.php pulls /stuff.php /fr/something/thisis.php pulls /something/thisis.php

without it being visible in the url.

+2  A: 

Something like this

RewriteRule ^([a-z]{2})/(.*) $2 [L,NC]

If you want to store the current language as a query-string value, try this

RewriteRule ^([a-z]{2})/(.*) $2?lang=$1 [L,NC,QSA]

If you use the second method, you can access the language in PHP like so:

$language = (preg_match('/^[a-z]{2}$/i', $_GET['lang']) ? $_GET['lang'] : 'en');
Rowan
A: 

Try

RewriteRule ^/.{2}/(.*)$ /$1 [QSA,L]

This will remove all 2 letter first directories

Dominik