我有演员和流派分类法。
add_action(\'init\',\'ap_url_redirect_rules\');
add_filter(\'query_vars\', \'ap_register_query_vars\');
function ap_url_redirect_rules(){
add_rewrite_rule(\'([^/]+)?$\', \'index.php?actor=$matches[1]\', \'top\'); // .com/brad-pitt
add_rewrite_rule(\'([^/]+)/([^/]+)?$\', \'index.php?actor=$matches[1]&sort=$matches[2]\', \'top\'); // .com/brad-pitt/popular or new, etc.
add_rewrite_rule(\'genre/([^&]+)?$\', \'index.php?genre=$matches[1]\', \'top\'); // .com/genre/comedy
add_rewrite_rule(\'genre/([^/]+)/([^/]+)?$\', \'index.php?genre=$matches[1]&sort=$matches[2]\', \'top\'); // .com/genre/popular or new, etc.
flush_rewrite_rules();
}
function ap_register_query_vars($query_vars){
$query_vars[]=\'sort\';
return $query_vars;
}
我有这个密码。演员重写规则有效,但体裁和单个帖子(帖子链接)无效(
404 Page Not Found). 我怎么了?