if you rewrite the query string in it entirety. It appears that substring manipulations are out of bounds, although I havn't looked at the mod_rewrite source code yet.