I’d like to rewrite calls from:
http:// domain.com/index.php?var1=value&var2=alpha&var3=numeric
To:
http:// domain.com
I’ve tried each of the following below without success. Can you suggest a better solution?
//#1
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^index\.php\?var1=value&var2=[^&]*&var3=[^&]*$ http://domain.com [R=301]
//#2
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^index\.php\?var1=value&var2=([A-Za-z-]+)&var3=([0-9-]+)$ http://domain.com [R=301]
You can not match a query string in a rewriterule.
Better use this:
These RewriteCond’s will be AND’ed, I’ve just split them up so you can see what they are doing, but also to match the query string even if the parameters are given in a different order.