0
A
回答
1
确定的要求这个URI“产品”完全匹配。如果向第三方发布代码就好像他们创建了一个名为product的页面,这是不可取的,它将遵循此规则。
顺便说一句,我假设你的意思post_type =页面(也将工作职位,看到post_id=
在add_rewrite_rule?你需要改变这要重定向到页面的帖子ID。
add_action('init', 'new_rewrite_rule');
function new_rewrite_rule(){
// matches product exactly, product/aproduct will fail, etc
// you need to add your own post_id into the function below.
add_rewrite_rule('^product$','index.php?page_id=12','top');
}
您将需要刷新重写规则这个工作(去固定链接设置页面,只需点击保存按钮)
代码版本的冲洗重写规则,不要让它在wp_loaded运行是一个好主意,应该在激活挂钩真的,但为了测试,这将做到:
function new_flush_rewrite_rules() {
flush_rewrite_rules();
}
add_action('wp_loaded', 'new_flush_rewrite_rules');
只需要注意,您也可以在帖子编辑屏幕中手动执行此操作。
相关问题
- 1. wordpress重写规则
- 2. WordPress的重写规则
- 3. WordPress的重写规则
- 4. WordPress的重写规则
- 5. wordpress:检测重写规则刷新
- 6. 在wordpress中刷新重写规则
- 7. Wordpress添加重写规则
- 8. WordPress |修改重写规则
- 9. htaccess wordpress https重写规则
- 10. htaccess wordpress/index.php重写规则
- 11. WordPress .htaccess重写规则
- 12. Wordpress重写css规则
- 13. Wordpress htaccess重写规则
- 14. htaccess重新写入规则失败
- 15. 错误重新写入规则
- 16. 的WordPress htaccess的重写规则
- 17. WordPress的重写规则不起作用
- 18. WordPress的重写规则需要解决
- 19. Wordpress中的特殊重写规则
- 20. WordPress的重写规则不工作
- 21. Wordpress中的自定义重写规则
- 22. 的WordPress:重写规则不起作用
- 23. MVC3 + WordPress的IIS网址重写规则
- 24. 除了WordPress的重写规则'
- 25. 自定义重写规则在WordPress的
- 26. 重写规则向前URL在WordPress的
- 27. 存档的Wordpress重写规则
- 28. 说明在WordPress的重写规则
- 29. Nginx的多站点WordPress重写规则
- 30. Apache重写规则新手
它只是这个网址或分类标准什么的? – David
@David Page URL :) –