Use mod_rewrite, yet keeping the "?"
RewriteRule ^(.*)\?*$ app.php?_target=$1 [L]
Now I would like to extend this rule to support URLs like this:
http://mydomain.com/articles/regex-cheatsheet/?sortby=expression&order=asc&filter=numeric
Here is a nice explanation for why I would like doing this. My rule looks like this now:
RewriteRule ^(.*)\?(.*)$ app.php?_target=$1&$2 [L]
I've validated this expression, as I am no regEx expert and it seems OK. Bu开发者_开发百科t, of course, it doesn't work :/
So does anyone know what I am doing wrong?
Use the QSA (Query String Append) flag:
RewriteRule (.*) app.php?_target=$1 [L,QSA]
精彩评论