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?

0


a source to share


1 answer


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.

+2


a source







All Articles