regex - 在 Wordpress URL 重写规则中连接 $matches
问题描述
我正在尝试在我的查询变量中使用 2 个正则表达式的结果来重写特定的 URL:
add_rewrite_rule('edition/([^/]*)/([^/]*)', 'index.php?pagename=$matches[2]-$matches[1]', 'top');
它不起作用,当:
add_rewrite_rule('edition/([^/]*)/([^/]*)', 'index.php?pagename=videos-$matches[1]', 'top');
完美的作品,所以似乎我没有正确连接这两个值,但我找不到正确的方法。有人有线索吗?
解决方案
推荐阅读
- typescript - 右 = |_a| 的 Rust 泛型类型实现 |b| b
- javascript - 动态路由反应
- r - 有没有办法使用水平顺序替换 R 中的 NA?
- javascript - 如何从 GraphQL API 获取数据并将其传递给其他函数文件?
- r - 错误:BigQuery 不支持临时表
- c# - 在 .NET Core 中返回具有多个 InvokeAsync 调用的视图组件时,控制器操作是否应该是异步的
- r - 我需要将一列日期转换为时间序列
- java - 无法使用 Java 发送 Post 请求
- python-3.x - fastapi如何将嵌套的json读取为字典?
- npm-install - 通过命令安装 cypress 时:npm install cypress --save-dev 出现错误,因为无法下载 Cypress 应用程序