How to change search url for Wordpress (redirect with special parameters)?
If you want to redirect your regular Wordpress search requests to another url then you need to use this php code and insert in into functions.php:
function wpb_change_search_url() {
if ( is_search() && ! empty( $_GET['s'] ) ) {
wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) );
exit();
}
}
add_action( 'template_redirect', 'wpb_change_search_url' );