我正在尝试此代码codex wordpress site
function custom_rewrite_basic() {
add_rewrite_rule(\'^leaf/([0-9]+)/?\', \'index.php?page_id=$matches[1]\', \'top\');
}
add_action(\'init\', \'custom_rewrite_basic\');
必须如何通过。必须为上述代码配置htaccess文件才能使其有意义?如果我把基本的wordpress
.htaccess
配置文件,然后我被重定向到同一页。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>