Change the Search-URL of WordPress - Add code in function.php and customize with directory
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\' );
Yes, it is also possible via htacces rules, but the source is an example for custom solutions on an redirect.
# search redirect
# this will take anything in the query string, minus any extraneous values, and turn them into a clean working url
RewriteCond %{QUERY_STRING} \\\\?s=([^&]+) [NC]
RewriteRule ^$ /search/%1/? [NC,R,L]