php - query string gets ignored after mod_rewrite -
i using following rewrite rule in .htaccess file send requests index.php file located @ root:
rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule (.*) index.php?q=$1 [l]
as expected, urls example.com/users result in php receiving ["q"]=> string(5) "users"
$_get variable.
urls example.com/users?fu=bar on otherhand not result in php receiving
["q"]=> string(5) "users", ["fu"]=> string(3) "bar"
what happening here, , how modify rule behave way?
you need add original query string:
rewriterule (.*) index.php?q=$1 [l,qsa] ^^^ here
Comments
Post a Comment