I'm trying to have a parameter that comes just after he hostname, as in:
www.domain.com/parameter
For this reason, I've set the following rewriteRule, for two parameter values that I'd like to operate with:
RewriteRule ^(en|pt)$ /index.php?language=$1&%{QUERY_STRING} [L]
Works fine! Although, I need to create a new rule, to redirect any request without one the parameters listed.
For that reason, I thought this would work:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^(en|pt)$
RewriteRule ^(.*)$ /pt/$1/ [L,R=301]
But unfortunately is showing a redirect loop.
I've been getting:
http://hostname/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt//
Any tips on how to fix this are appreciated!