How to make /search/ without parameters not return a 404?
The search rewrite rule only captures the pattern search/(.+)/?$. A request to search/ matches the root pages rule, so WordPress tries to find a page with that slug. You could create a page at that location and load a template via a filter, or, you could add a rewrite rule that just does an empty …