Php 如何制作正确的Wordpress重写API?
我有这个插件,不工作Php 如何制作正确的Wordpress重写API?,php,wordpress,.htaccess,mod-rewrite,Php,Wordpress,.htaccess,Mod Rewrite,我有这个插件,不工作 add_action( ‘init’, ‘ao_add_rewrite_rule’); function ao_add_rewrite_rule() { add_rewrite_rule( ‘freemium’, ‘index.php?areas=promenade-des-anglais-sea-side-living&price=1000000′, ‘top’); flush_rewrite_rules(); } 我想要这个: localho
add_action( ‘init’, ‘ao_add_rewrite_rule’);
function ao_add_rewrite_rule() {
add_rewrite_rule( ‘freemium’, ‘index.php?areas=promenade-des-anglais-sea-side-living&price=1000000′, ‘top’);
flush_rewrite_rules();
}
我想要这个:
localhost/wordpress/property-for-sale/?areas=promenade-des-anglais-sea-side-living&price=1000000
这样写:
localhost/wordpress/property-for-sale/freemium
它不起作用了。我发现错误404未找到。可能会从添加重写规则行中删除'index.php',因为您没有将它放在“我想要这个”下。只放区域=英格兰海滨长廊生活&价格=1000000?待售房产和区域是通过分类的类型(自定义字段)制作的。