I have rewritten a URL with .htaccess so that it looks prettier. But when I add a query string to this URL, the keys and are not visible from PHP.
In my .htaccess file, I tried several things to fix the problem, but nothing worked.
RewriteEngine On
[some code]
RewriteRule ^([a-zA-Z0-9_-]+)/?$ ?site=$1
I have tried this rewriting, to see if it works:
RewriteRule ^search?q=g ?site=search&q=g
But if I print_r($_GET) in PHP, I will just get Array ( [site] => search )
Try it on http://kwtsports.bplaced.de/search?q=g.
I have a search field that redirects to /search?q=blablaSearchQuery, but as I said, $_GET['q'] is empty.
This also doesn't work:
RewriteRule ^search?q=([a-zA-Z0-9_-]+)/?$ ?site=search&q=$1
Does anyone know why this happens?