Wordpress URL重写无效

时间:2017-05-09 17:35:53

标签: php regex wordpress url-rewriting

我已将此添加到我的functions.php页面:

function custom_rewrite_basic() {
   add_rewrite_rule('^leaf/([0-9]+)/?', 'index.php?page_id=$matches[1]', 'top');
}
add_action('init', 'custom_rewrite_basic');

但是当我去http://example.com/leaf/1234时,我会得到一个时髦的404页面。有谁知道发生了什么事?

0 个答案:

没有答案