podaac / swodlr-ui

User Interface for On-Demand Raster Generation System
2 stars 1 forks source link

Create default 404 page #53

Closed frankinspace closed 1 year ago

frankinspace commented 1 year ago

Create a 404 page that is shown by default when there is a page not found.

I believe we will have to enable static website hosting on the s3 bucket: https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html

Which can be done via terraform: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration

frankinspace commented 1 year ago

Correction: We do NOT enable static website hosting. We just create the 404 page and upload it to our site bucket. Then we let NGAP know the name of the document and submit a NASD ticket.

https://wiki.earthdata.nasa.gov/pages/viewpage.action?pageId=316087227#EarthdataCloudEgressCustomErrorPages-SubmittingNASDticketforCustomErrorPagesonaEDCTenantAccount

No changes are required for our terraform.

frankinspace commented 1 year ago

After some investigation it became apparent that a more complicated solution may be needed here to do this properly. The solution for now will be to set the error page for 403 and 404 to use index.html. This will cause the requests to be handled by the react app and display the NotFound page as expected. However, this is not an ideal solution as it causes client redirects and interferes with SEO (see discussion https://stackoverflow.com/a/70059194).

frankinspace commented 1 year ago

@viviant100 Please submit the NASD ticket with the following information:

CloudFront URL: swodlr.podaac.sit.earthdatacloud.nasa.gov Error Code: 403, 404 Path under podaac-svc-sit-swodlr-ui: index.html Transformed error code: 200

We will want a similar ticket for UAT

frankinspace commented 1 year ago

Follow on enhancement ticket opened to address the issues with using index.html as the error page: https://github.com/podaac/swodlr-ui/issues/56

viviant100 commented 1 year ago

CloudFront URL: swodlr.podaac.sit.earthdatacloud.nasa.gov Error Code: 403, 404 Path under podaac-svc-sit-swodlr-ui: index.html Transformed error code: 200

Done: https://bugs.earthdata.nasa.gov/servicedesk/customer/portal/7/NASD-3835.