How do I redirect /search/ to wordpress search template?
You can use template_redirect. Here a simple redirection function. add_action( ‘template_redirect’, ‘se219663_template_redirect’ ); function se219663_template_redirect() { global $wp_rewrite; if ( is_search() && ! empty ( $_GET[‘s’] ) ) { $s = sanitize_text_field( $_GET[‘s’] ); // or get_query_var( ‘s’ ) $location = “https://wordpress.stackexchange.com/”; $location .= trailingslashit( $wp_rewrite->search_base ); $location .= user_trailingslashit( urlencode( $s ) ); $location … Read more