php - WordPress 阻止 add_rewrite_rule 重定向
问题描述
在 WordPress 网站上,我想要来自的内容
http://thesite.com/cars显示 http://thesite.com/cars/index 中的内容
我正在尝试使用以下重写规则来做到这一点:
add_rewrite_rule(
'cars/?$',
'index.php?page_type=cars&name=index',
'top');
它可以工作,只是它重定向到http://thesite.com/cars/index
有什么方法可以防止重定向发生吗?
解决方案
推荐阅读
- android-studio - 如何在 Android Studio 中为填充的三角形(由路径绘制)设置动画
- ios - 如何使用 Firebase 将帖子连接到用户并显示该用户并在 TableView 的自定义单元格中发布数据
- xamarin - 如何在不从 Xamarin.Forms 的第一页重新启动应用程序的情况下重新创建 Android 中最顶层的 Activity?
- swift - 使用 vapor-fluent 来更新模型
- flutter - 如何防止水平 ListView 项目拉伸
- html - 将子元素设置为父元素的 100% 高度,而不考虑其他兄弟元素
- java - How to enable Maintenance mode in spring boot
- javascript - vue 组件数据和计算属性
- java - 使用 Java Stream 从 ArrayList 获得最高分
- dart - TextField 的自动对焦属性导致小部件进入“脏”状态