wordpress搜索结果url重定向

1
2
3
4
5
6
7
8
9
10
<?php
if($_GET['s']!=''){
$change = array('+',' ');
$kwds = strtolower( $_GET['s'] );
$kwds = trim($kwds);
$searchredirect = get_settings('home') . '/search/' . str_replace($change, '-' ,$kwds). '/';
header("HTTP/1.1 301 Moved Permanently");
header( "Location: $searchredirect" );
}
?>