Why this is required to do ?
Because S3 website doesn’t know URL rewriting concept which other server knows. Whenever type any route path its should land first on index.html then further. Need to give command to S3 setting and AWS Cloudfront error response code.
- Create a Angular build
- Copy paste dist folder source and paste into S3 bucket
- Set up S3 website hosting index and error page to index.html
- Once completed uploading a code into S3 create Cloudfront as per your requirement and assign bucket to it.
- Go to Error response tab in Cloudfront set up value as per below reference images