Added query support when using RewriteRule