Reputation: 107
I am trying to host a site with muliple paths on a S3 Bucket. Is this an available option ?
localhost:3000
localhost:3000/policy
example.com <-- Works
example.com/policy <-- does not work with no key error
404 Not Found Code: NoSuchKey
Message: The specified key does not exist.
Key: policy
I am using React-Router-Dom switch on the App that is working on localhost
<Switch>
<Route path="/policy"><PolicyComponent><Route>
<Route path="/"><HomePageComponent><Route>
<Switch>
Upvotes: 0
Views: 2688
Reputation: 107
react router doesn't work in aws s3 bucket
Very Simple Fix,
All I needed to do was indicate any errors to index.html
I did not provide index.html on the set up.
Upvotes: 6
Reputation: 46869
If the html file name is 'policy.html', they you need to reference it as such, if you want the url to just be example.com/policy, you would create a folder called 'policy' under the root and put the contents in a file called index.html in that bucket.
Upvotes: -1