reactjs - Next.js 将 old-url 重定向到 new-url next.config 问题
问题描述
我需要为我的 Nextjs 应用重定向路线。例如,我有如下路线:
domain-name.com/keyword?=type_anything
我想用以下内容替换它:
域名.com/type_anything
我正在尝试使用next.config.js如下所示:
async redirects() {
return [
{
source: '/keyword?=:slug',
destination: '/:slug',
permanent: true,
},
]
},
}
解决方案
推荐阅读
- php - Phalcon\Forms\Form 将 emtpy 字段绑定为 null
- node.js - 我使用 npm install 然后它给了我一个错误
- c++ - C++ 继承重载具有不同参数的函数
- html - 表格中的 Html 不同照片尺寸
- rx-java2 - 使用 RxJava2 类型返回的更新查询给出错误:不确定如何将游标转换为此方法的返回类型
- reactjs - 反应 - 超过最大更新长度
- swiftui - 使用深度嵌套值的绑定时 SwiftUI 崩溃
- php - 如何更改过滤的href链接?
- computer-science - 我不明白为什么这段代码不会运行
- c# - 不同用户会话的相似记录数