javascript - 使用 gatsby-plugin-netlify 从 Netlify 重定向到自定义域?

标签 javascript reactjs gatsby netlify

我有一个像这样的 _redirects 文件:

https://example.netlify.com/* https://example.com/:splat 301!

在根文件夹中。

如何使用 gatsby-plugin-netlifyhttps://example.netlify.com 域重定向到 https://example.com ?

最佳答案

您需要将 _redirects 文件放在 static 文件夹中,因为 Netlify 会在 build (/public) 文件夹中查找它,不是来源。

关于javascript - 使用 gatsby-plugin-netlify 从 Netlify 重定向到自定义域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51569457/

相关文章:

javascript - 使用多个 html 页面或通过 javascript 显示/隐藏 div

reactjs - 为什么所有 Recompose 配方都以 "const { Component } = React;"开头

javascript - 为什么它说 'next' is not Defined in redux middleware code.中间件的下一个方法是否已弃用?

javascript - 简单的 Ajax 请求,在 React.js 中循环数据

javascript - 更新 HTML 文件文件夹中的所有 href anchor 链接

javascript - 多个获取请求,使用 gatsby-node 创建 Node (async/await)

reactjs - gatsby 中的静态文件图像路径

JavaScript execCommand ('copy')不工作

javascript - $.getJSON 在成功的 http 请求上失败

javascript - 文本按字长对齐