I have a PHP page with querystring:
http://project.dev/?a=b&c=d
As you know, I can access the querystring with $_GET superglobal array:
print_r($_GET);
/*
Array
(
[a] => b
[c] => d
)
*/
I want to remove questionmark from querystring with Apache and htaccess, so when a user see my website with this address:
http://project.dev/a=b&c=d
It will be identical to this address:
http://project.dev/?a=b&c=d
and I can access the querystring as before: with $_GET superglobal array.
Some Important Notes:
I don't want to redirect user from URL without question mark to the URL with question mark.
I have both
GETandPOSTrequests to this page.The querystring can have questionmark
?itself, for example:
http://project.dev/?a=b&c=d?x=y.I want the addresses with question mark, automatically redirect to the one without question mark. For example when a user come to my site with this address:
http://project.dev/?a=b&c=d
I want to redirect user to this address:
http://project.dev/a=b&c=d.My website has only one page:
index.php. Without any subfolders.
How can I do this in htaccess?