RewriteRule does not obey
http: //localhost/allsides/.htaccess
RewriteRule (. *) Index.php? $ 1 [L]
http: // localhost / allsides / test
One or more characters after allsides / are stored in $ 1
$ _ GET - $ 1.
test is not $ _GET!
What's wrong?
When requested …?test
, the key of the first $_GET
s elements will be test
, rather than have a value (equal …?test=
).
So either use current(array_keys($_GET))
to get the key of the first item $_GET
or use $_SERVER['QUERY_STRING']
to get the full query.
a source to share