Here is my .htaccess file
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule subpage\?sid /index.php [R=301,L,NC]
My request is http://example.com/subpage?sid
It keeps returning 404 Not Found, rather than redirecting to index.php
I have tried not escaping the ? and changing the request to http://example.com/subpage\?sid
I have tried loads of things to try get this working but am now stumped.
The QUERY_STRING is not part of the URI. From the documentation for RewriteRule:
As the doc says, you’ll need to use a RewriteCond, something like:
If %{QUERY_STRING} truly isn’t an option, try:
Also, you almost never need RewriteBase as you’re using it (“RewriteBase /”). Comment the line and test it to be sure, but you’ll probably find you can delete it with no ill affect.