Search uses index.php instead of search.php on renaming search field from “s”

Well, the s is not just a name/ID, it’s a query var, as the form’s fields are injected by means of GET or POST to the URL which is then checked for the s query var.

If the s query var is defined, the search.php (if present in your theme) will then be called automatically.

It’s okay if you have multiple searchboxes having fields that share the same name. Each searchbox has its own form anyway.

In short: rename the search’s input field back to s (or tweak the redirects/rewrites etc. which is nonsense, in my opinion).

Leave a Comment