I’m getting my feet wet with mod_rewrite.
What I’m trying to accomplish is to only allow a specific querystring and disallow all others but am getting very confused.
RewriteEngine On
# just commented these to show what I also tried.
#RewriteCond %{QUERY_STRING} !id=1234
#RewriteRule .* /index.php? [R=301,L]
RewriteCond %{QUERY_STRING} !id=1234
RewriteCond %{QUERY_STRING} ^$
RewriteRule .* /index.php? [R=301,L]
Reading online I see the exact same thing I have with the !id=1234 and people say it works for them. It redirects if there is no query string but I can enter ?poi=poi and there is no redirect.
Thank you.