wordpress - 如何从子帖子中删除父 slug
问题描述
我需要一种方法来忽略子帖子中的父项。但是没有使用任何插件。
Coming: http://test.com/test-parent/test-child
Desired: http://test.com/test-child
解决方案
您将需要 Apache 的重写模块:mod_rewrite
.
然后做这样的事情:
RewriteEngine on
RewriteRule ^test-parent/(.*)$ $1
这里是mod_rewrite的官方文档:点击
推荐阅读
- dbus - 使用 busctl 创建日志条目
- sql - 在 SQL 表中创建唯一约束时出现语法错误
- csv - 在 csv 文件的第一行末尾添加分号 -groovy
- hugo - 如何修复我的 Hugo 社交分享部分中的链接不可抓取
- node.js - 由于数据库中有多个用户名(nodejs、jade、npm),Passportjs 登录无效
- vba - 将访问字段插入单词表
- python-3.x - dask 合并失败并出现 keyerror
- c++ - C++ 程序在 Visual Studio 2010 中编译但不是 Mingw
- python - matplotlib 中 -: 'str' 和 'str' 不支持的操作数类型
- laravel - Laravel 将数据从 Event 发送到 Listener 并获得 Unresolvable dependency resolve [Parameter #0] 错误