aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
450 stars 113 forks source link

Rewrite and redirect rules don't work for files without extension #3622

Open strangehelix opened 1 year ago

strangehelix commented 1 year ago

Before opening, please confirm:

App Id

d2onlp7qsnn3r1

AWS Region

us-west-2

Amplify Hosting feature

Redirects

Frontend framework

React

Next.js version

N/A

Next.js router

N/A

Describe the bug

Rewrite rules don't work when source URLs point to a file without an extension.

EXAMPLE:

This will not work

source: /.well-known/apple-developer-merchantid-domain-association target: /apple-developer-merchantid-domain-association.json Error: HTTP 403

This will work

source: /.well-known/apple-developer-merchantid-domain-association.json target: /apple-developer-merchantid-domain-association.json

Expected behavior

This should have worked source: /.well-known/apple-developer-merchantid-domain-association target: /apple-developer-merchantid-domain-association.json

and content of apple-developer-merchantid-domain-association.json should be served.

Reproduction steps

In Amplify App Settings:

  1. Open "Rewrites and redirects"
  2. Add a rule with a source "/.well-known/apple-developer-merchantid-domain-association" and put any existing location in target, for example "/".
  3. Open /.well-known/apple-developer-merchantid-domain-association and observe 403 error.

Build Settings

No response

Log output

``` # Put your logs below this line ```

Additional information

No response

gobacknforth commented 10 months ago

Also having issues with this. Trying to use rewrites on my "/" page to go to "/site/index.html" and it 404s. This used to work a month or two ago, but some change in Amplify has broken it.