This site I'm working on has WordPress installed under the subdirectory /2020/, with the home page set to /. It uses a plugin for the menu system and the search bar, but the plugin sets the search bar action URL to the site URL (/2020/), not the home URL. There must be a way to rewrite URLs in the .htaccess so that /2020/?s=foo gets rewritten to /?s=foo. So far I've tried this in the /2020/.htaccess file, but it makes no difference:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /2020/
RewriteCond %{QUERY_STRING} s=[^&]+
RewriteRule . /index.php [L,QSA]
  • What's the name of the plugin used for adding the search bar? – Levi Cole Dec 18 '19 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.