Reputation: 2457
I'm running my frontend off of AWS Amplify and I can't figure out how to get the sitemap to appear. It just keeps on saying error 404 on aws amplify. but on localhost it goes straight to it. robots.txt
works fine on both though.
Here are my AWS Amplify settings. And if it helps, I'm using React
[
{
"source": "https://www.my-domain.com",
"target": "https://my-domain.com",
"status": "301",
"condition": null
},
{
"source": "/<*>",
"target": "/index.html",
"status": "404",
"condition": null
},
{
"source": "</^((?!\\.(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|xml)$).)*$/>",
"target": "/index.html",
"status": "200",
"condition": null
},
{
"source": "/sitemap.xml",
"target": "/sitemap.xml",
"status": "200",
"condition": null
}
]
Anybody know what might be the cause for it going to 404? I've tried putting sitemap above, below and removing it. Also adding/removing xml from the third setting.
Upvotes: 0
Views: 1911
Reputation: 21
One solution is to change the rewrites and redirect settings in AWS Amplify to allow file types ending in .XML to be returned and not forwarded to the root URL (/).
Upvotes: 1
Reputation: 2457
Solved it.
sitemap.xml
exactly.Even though AWS was updating the URL. It had cached results.
Upvotes: 0