页面的重写 url 仅指向索引 [英] Rewrited url for page just points to index

查看:39
本文介绍了页面的重写 url 仅指向索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临的问题如下:

我在 Wordpress 中创建了一个新页面,网址重写为/foo/".可能我撞到了什么(只是在管理面板中配置而不是在数据库中!)现在/foo/只指向我的索引而不指向给定页面(不再!).如果我只是将 '/foo/' 更改为类似 '/foo-1/' 的内容,它可以完美运行.

I created a new page in Wordpress with a url rewrite '/foo/'. Probably I hit something (just configured things in the Admin panel not in the database!) an now /foo/ just points to my index and doesn't point to the given page (anymore!). If I just change '/foo/' to something like this '/foo-1/' it works perfectly.

我认为很难弄清楚哪里出了问题,但也许有人有好的建议或知道我需要从数据库中删除哪些数据!

I think it's to hard figure it out what goes wrong but maybe someone has a good suggestion or knows which data I need to remove from the database!

提前致谢,

尼克

推荐答案

每当您摆弄 URL 重写(尤其是新的 custom_post_types 和分类法,但基本上无处不在)时,不要忘记 flush_rewrite_rules(); 基本上负责刷新WP重写规则(就像它的名字一样) - 因此允许您在没有冲突的情况下声明新的.

Whenever you are fiddling with URL rewrites ( especially with new custom_post_types and taxonomies, but basically everywhere ) it is very important not to forget flush_rewrite_rules(); which basically take care of flushing the WP rewrite rules ( like it's name ) - thus allowing you to declare new ones without a conflict.

这篇关于页面的重写 url 仅指向索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆