Using AWS Amplify, can I do 301 redirect from /**/index.html to /**/?

Viewed 98

Does AWS Amplify support dynamic matching syntax?

It works:

[
    {
        "source": "/<*>/index.html",
        "target": "/<*>/",
        "status": "301",
        "condition": null
    }
]

It can redirect /example/index.html to /example/, but /example/foobar/index.html is not redirected to /example/foobar/.

It seems that wildcard can't include any shashes.

It doesn't work:

[
    {
        "source": "/^(.*)\\/index\\.html$/",
        "target": "/$1/",
        "status": "301",
        "condition": null
    }
]

() cannot be reused by $1.

My workaround:

enter image description here

0 Answers
Related