I am trying to rewrite an URL so that a passed variable is replaced with a new id, for example;
wwww.domain.com/default.php?s=1&lang=en
To be rewritten to:
www.domain.com/default.php?id=1$lang=en
The s variable being replaced with id
I have tried:
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteCond %{QUERY_STRING} ^s=(.+)$
RewriteRule ^s=(.+)$ id=$1 [R,NC,L]
also
RewriteRule ^s=(.+)$ id=%1 [R,NC,L]
no luck… what am I doing wrong?
Thanks for any help!!
This should work if even if you don’t have
sas the first variable. (Not sure what you really want.)