In order to disallow multiple language folder repetition in my website http://domain.com/en/fr/es/
I set the following rule:
RewriteRule ^([a-z]{2}/){2,}(.*)$ /$1$2 [R=301,L]
It's working nice but my problem is that the first captured group return es
, but I'd like to get the first language folder en
. How can I do that?
I'm using the following directives to hide .php extentions: `RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)/$ /$1.php` But it seems like the page is sometimes loaded twice! do you see anything wrong? Thanks a lot – Websphere Nov 05 '16 at 22:23