I'm a real newbie regarding mod_rewrite so please don't laugh. I am using this tool for testing: http://civilolydnad.se/projects/rewriterule/
Basically I want to rewrite
http://hostname/spanish/whatever/
into
http://hostname/whatever/?lang=es
Here's the best I could come up with:
RewriteRule ^spanish/(.*)$ $1?lang=es [QSA,L,NC]
which seems to work except when the requested page already has parameters. In that case
http://hostname/spanish/gallery/photos/?page=2
gets rewritten as
http://hostname/spanish/gallery/photos/?page=2?lang=es
Can anyone help this confused newbie? Thank you very much.