admin管理员组文章数量:1287496
How should I approach this issue?
I want to create one page, but many "virtual pages", e.g. like a productinfo.php. A product has several. In this case you manually create the posts in the database through dashboard and the virtual pages are pointing to specific posts in the WP database.
What I want is this is kind of same thing but I don't want to add any posts and I want all virtual pages to redirect to same page with different GET request:
Let met explain:
- I create one page: e.g. cityinfo
- If I go to /luton it should point to cityinfo?actualcity=Luton
- If I go to /london it should point to cityinfo?actualcity=London etc.
Should I be using .htaccess for this? Or am I missing some easier/better way to achieve this?
How should I approach this issue?
I want to create one page, but many "virtual pages", e.g. like a productinfo.php. A product has several. In this case you manually create the posts in the database through dashboard and the virtual pages are pointing to specific posts in the WP database.
What I want is this is kind of same thing but I don't want to add any posts and I want all virtual pages to redirect to same page with different GET request:
Let met explain:
- I create one page: e.g. cityinfo
- If I go to /luton it should point to cityinfo?actualcity=Luton
- If I go to /london it should point to cityinfo?actualcity=London etc.
Should I be using .htaccess for this? Or am I missing some easier/better way to achieve this?
Share Improve this question edited Oct 15, 2021 at 16:16 bestprogrammerintheworld asked Oct 15, 2021 at 15:27 bestprogrammerintheworldbestprogrammerintheworld 1,3212 gold badges19 silver badges40 bronze badges 01 Answer
Reset to default 1I actually found a rather easy way to achieve this:
add_rewrite_rule( 'city/([a-zA-Z]+)/?$',
'wp-content/plugins/csv-to-html/templates/csvtohtmlpage_core.php?city=$1' );
Yes, I know I did not mention city/ in the beginning but I just wanted wanted to know how should I achieve this. If someone has better ideas. Please tell me! :-)
本文标签: redirectUse virtual pages point to one specific page
版权声明:本文标题:redirect - Use virtual pages point to one specific page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741266837a2368635.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论