-1

So I'm pretty new at using S3 as a place to host my websites. A few things I need assistance on...

One, S3 requires you to use 'index.html' as the entry point. However I built my site with React, and my dashboard component is my 'homepage' and should be the entry point. How do I change/redirect my site to automatically go to my dashboard component?

*When a user clicks my link all they see is a blank page with my nav bar.

Secondly, when your path is not on /index.html and you hit refresh you get a 403 error page with 'NoSuchKey' as the error code? Why is that and how do I change that?

Anyone in the universe please help! Thanks!!

Brai
  • 1
  • Are you using a Static Hosted Website? If so, the URL would look like `http://my-bucket.s3-website-us-west-2.amazonaws.com` and you can configure the default page (which does _not_ need to be `index.html`). If you are _not_ using a static hosted website, then there is no automatic redirection and you would need to specify the exact URL to use. – John Rotenstein Jan 16 '19 at 23:10
  • You should share all the relevant code so people know what you have done so far and help you better. – IvanS95 Jan 16 '19 at 23:11
  • Are you using `React-Router`? If so, can you show what is inside of your ``? – Jordan Daniels Jan 16 '19 at 23:12

1 Answers1

2

You need to redirect 404s to your app's entry file (typically index.html). From there, your React application should handle routing on the client. Possible dupe of S3 Static Website Hosting Route All Paths to Index.html

Alan Friedman
  • 1,255
  • 8
  • 7