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 search:
function wpd_empty_search_fix(){
add_rewrite_rule(
'^search/$',
'index.php?s=",
"top'
);
}
add_action( 'init', 'wpd_empty_search_fix' );
Related Posts:
- Changing permalinks gives me 404 errors on nginx
- Pretty permalinks for search results with extra query var
- Setting 404 page in Nginx
- Including category-base in a post permalink results in 404
- WordPress thinks my custom route is a 404
- 404 on category.php pagination
- custom naming of search permalink /search/
- Posts not working on windows after changing permalinks
- Rewriting search permalink
- Redirect old permalinks with Month and name to Post name on new site
- Search result permalink
- Permalinks Structure and 404 Question
- Attachment page 404 not found when image is attached to post
- After moving from subdirectory to home, home page does not display
- Changes to permalink structure results in 404 error for all pages other than home
- Permalinks broken regularly
- 404 Page Not Found for Only One Post
- Permalink /%category%/%postname%/ returns 404 on OSX
- Permalinks keep reverting to 404 unless I re-save them
- Clean install – Changing permalinks in twentyeleven give 404
- Problems redirecting to “pretty” permalinks (wordpress in Subdirectory)
- Changing search URL to something other than “search”
- Permalink change made author archive vanished
- Permalinks okay some pages but 404 error on others
- Custom permalink for search and pagination
- AWS WordPress Install – pages/posts 404 on restart until updating permalinks
- WordPress 404 in development area
- Custom Permalink
- page nested 3 levels deep shows 404
- Nginx Rewrite Rule:: index.html added to every permalink
- Moving local wordpress page to a real server subdomain broke my permalinks?
- 404 Error Problems with sCategory Permalink plugin
- Why does the ‘Month and Name’ Permalink Format not Work on my new WordPress Site (running on IIS7)?
- Is there a link parameter that will show me all my published pages?
- Page preview is shown, updating page gives 404 error
- Edit page slug after save, cause 404 by linked pages
- Correct permalinks and 404-error
- What would cause a theme to add extra characters to blog post links?
- Permalink Doesnt Work – URL Not Found
- Getting 404 when Access post which name start with Digit
- 404 when going to /blog
- Permalinks 404 error with HTTPS host
- Permalinks stopped working – NO update, mod_rewrite enabled, .htaccess not touched
- Custom permalink structure gives 404
- Accessing Subdirectories in WordPress Install
- Post preview gives 404 when permalinks are purely date based
- Permalinks on post is working, on pages 404 error
- Visiting posts results in 404 errors after host migration
- encoded search terms with %20
- 404 permalink errors on Pages only
- How to add specific phrase to end of search url
- Home page Pagination – Other pages do not redirect to home page template
- WordPress pages and posts are redirecting to server IP address instead of domain URL [closed]
- Fix 404 error after changing permalink structure
- Why does enabling Permalinks make pages not found?
- WordPress Permalinks 404 bug with “next” button
- Changing permalink settings causes 404
- Main blog page works but title says Page not found
- how to set up wp in folder within static website?
- permalink and add_rewrite_rule – error 404
- WordPress permalink change causes all incoming links to give 404 errors
- using wp_redirect to redirect to a permalink
- old permalinks not found
- The requested URL was not found on this server [closed]
- WP-e-commerce (getshopped) – Annoying permalink issue [closed]
- Browsing to permalink prefix results in 404
- Xampp 7.3.3 fresh install of WordPress 404 pages unless permalink is set to plain
- MySQL-inserted custom taxonomy term lead to 404, flush rewrites doesn’t help
- WordPress /page/2 gives 404 when custom permalinks is set to %category%%postname%
- Cannot make custom search permalink to work in a fully custom theme. Search string $_GET[‘s’] is always empty
- Extending page urls without getting a 404
- Giving specific category posts its own permalink structure returns 404
- 404 on pretty permalinks when serving via HTTPS
- 404 error on published page with specific permalink
- Permalink issue with WordPress Site at domain root and another WordPress Site in a Subfolder
- 404 page not found – Yet open admin page it works
- Custom permalink gives 404 error only in some pages
- Every sub page shows Error 404, i have check permalink but still same issues
- Remove Permalink of certain posts
- Problem with permalinks
- wp_dropdown_categories links 404
- LetsEncrypt WordPress on the Raspberry Pi – Nice url’s give 404 with https, http works
- WordPress search seems to look into permalink (which is bad)
- Permalink Rewrite with Archive – Archive gets 404
- Change the permalinks structure
- Page_link change
- Accidentally changed the permalink structure
- Search page Paginations not working
- Folder Name and Category Name WordPress
- Although rewrite engine is on, I get 404 not found on every page
- Pretty Permalink for Search Queries Not Working
- Only homepage working correctly, 404 error on everything else
- Permalink / sub-template issue
- 404 error on second page load for child-pages
- Search points to /search/?s=KEYWORD instead of /search/KEYWORD
- WordPress 3.1 problem, getting 404
- Parent pages not found with pretty permalinks
- Plugins, themes and other dashboard links including permalinks giving 404 error
- WordPress Permalinks 404 Not Found
- Non english characters in search bar