reactjs - 即使在设置了重定向后,ReactJS 应用程序也无法在 AWS Amplify 上使用 www
问题描述
这是我第一次在 AWS Amplify 上部署 React 应用程序。如果我在浏览器中使用https://www.domainxyz.com ,该应用程序可以正常工作,但如果我使用 https://domainxyz.com,它就无法正常工作
我已经在应用程序设置-> 重写和重定向中进行了如下更改,但重定向仍然不起作用。
[
{
"source": "https://domainxyz.net",
"target": "https://www.domainxyz.net",
"status": "302",
"condition": null
},
{
"source": "</^((?!.(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$).)*$/>",
"target": "/index.html",
"status": "200",
"condition": null
},
{
"source": "/<*>",
"target": "/index.html",
"status": "404",
"condition": null
}
]
解决方案
推荐阅读
- ios - Obj-c - 在 UIWebView 中打开 PDF?
- linux - 在文件中多次替换单词之间的字符串
- python - 在 Julia 中,将逗号插入整数以进行打印,如 Python 3.6+
- sql - SQL 查询以查找前 80% 的贡献
- c# - C# 编写包含未知数量的同名节点的 XML 文件
- json - 快速格式化 JSON:JSON 写入中的类型无效 (OS_dispatch_data)
- oauth - In OpenID Connect, is it okay to pass an id token instead of an access token to a resource server for authorization?
- qt - QML 简单程序未运行
- haskell - Eta 转换以严格的语言改变语义
- c - C中sizeof计算char a[]和char *a有什么区别?