by default wordpress search results go to sitename.com/?s=terms but i would like it be changes to sitename.com/search/?s=terms
I have tried using the
fb_change_search_url_rewrite() {
if ( is_search() && ! empty( $_GET['s'] ) ) {
wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) );
exit();
}
}
add_action( 'template_redirect', 'fb_change_search_url_rewrite' );
This get close as now when you do search it goes to search/searchterm but does not have the ?s= in the url
Alternatively, you can change the rule in .htaccess
Add the following on the line after “RewriteBase /”:
See reference here: http://wordpress.org/support/topic/change-default-search-string-s-to-permalink-structure