I am using MVC pattern in PHP
and rewrite urls this way:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
Now the problem is i wanna to use $_GET
method and when I use ?
after this character doesn't show in result for e.g:
http://localhost/site/register/?Authority=716&Status=NOK
Now the result after rewrite is : site/register/
I wanna to have all of link for use :
$Authority = $_GET['Authority'];
$Status= $_GET['Status'];
Fix the rewrite rule to
RewriteRule ^(.*)$ index.php?url=$1 [PT,L, QSA]
the QS flag tells apache to append the existing query string.
see https://httpd.apache.org/docs/current/en/rewrite/flags.html#flag_qsa