将 wordpress 调用重定向到页面 [英] redirect wordpress calls to a page
问题描述
我不确定这样做的最佳方法是什么.假设您已经设置了这样一个页面:
I'm not really sure what is the best way to do this. Say you have set up a page like so:
www.myblog.com/page1
是否可以指定将对 page1 下任何子页面的请求重定向到单个页面?假设我有 page1.php 作为我的页面之一,任何带有以下前缀的 URL:
Is it possible to, specify that the request to any of the subpages under page1 be redirected to a single page? Say if I had page1.php as one of my pages, any URL that is prefixed with:
www.myblog.com/page1/...
wordpress 将使用该文件生成页面.
wordpress would use that file to generate the page.
基本上,我有一些我想用 php 获取的自定义内容,这取决于正在加载的子页面.自定义内容的格式始终相同,只有参数"不同.有没有办法在 Wordpress 中做到这一点?如果没有,我应该从哪里开始寻求实施?
Basically, I have some custom content that I want fetched with php, and it depends on which subpage is being loaded. The format of the custom content is always the same, only the 'arguments' differ. Is there a way to do this within Wordpress? And if not, where should I should I start looking to implement this?
谢谢
推荐答案
尝试修改 .htaccess 文件并重写 url,以便/page1/page2 的所有请求都将重写为/page1=?page=page2 或类似的内容
try modifying .htaccess file and rewriting url so all requests for /page1/page2 will be rewrite to /page1=?page=page2 or something like that
这篇关于将 wordpress 调用重定向到页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!