I want to change index.php?search=X&page=B to /search/B/X.html I have RewriteRule ^search/([^/]*)/([^/]*)\.html$ /index.php?page=$1&search=$2 [R=301,L] but I want to make it change to the rewritten one when someone submits on my form
The left side of RewriteRule is what you want to change, the right side is what you want to change it to. So your expression should be something like the follows (UNTESTED!): RewriteRule ^index\.php\?search=(.+)&page=(.+)$ /search/$2/$1.html [R=301,L]