Forum Moderators: phranque
Are rewritten to (respectively):
I'm trying this:
RewriteRule ^(..)/([^\?]+)\?(.*)$ /$2?language=$1 [NC,L]
But it's not working. When I see the Rewrite Log, it shows up the following:
(3) [per-dir /home/mysite/public_html/] applying pattern '^(..)/([^\?]+)\?(.*)$' to uri 'en/index.php'
(1) [per-dir /home/mysite/public_html/] pass through /home/mysite/public_html/en
It doesn't match but it's showing an URI without the complete query string. I tryied to replace [NC,L] for [QSA] but still not working.
Does anybody know what I'm missing here?
Best regards
I've done this:
RewriteRule ^(..)/(.*)$ /$2?language=$1 [QSA,L]
And it works ok. It strips the first two letters and appends the variable at the end of the query_string
Another question..i'm trying to handle uRL that ends with the two letter (without "/") and it's not working:
RewriteRule ^(..)[/]?(.*)$ /$2?language=$1 [QSA,L]
Is there a way to have it in only one rewrite_rule? or I have to add this one:
RewriteRule ^(..)$ ?language=$1 [QSA,L]
Best regards and thanks
César Enrique