ovizii
4/10/2014 - 3:19 PM

Update WP Search Permalink URL

Update WP Search Permalink URL

function 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' );