I want to redirect these URLs:
http://example.com/search to http://example.com/?page=search
http://example.com/search?q=keyword to http://example.com/?page=search&q=keyword
I am trying to use this in .htaccess but doesn’t work:
RewriteRule ^search$ ?page=search [nc]
RewriteRule ^search\?(.*)$ ?page=search&$1 [nc]
What am I doing wrong?
Assuming you want to direct the request to the index.php file include the file in the rules. E.g.
Give it a try.