DEV Community

loading...

Discussion on: ⚡️ 5 Minute Tutorial: Deploying a NextJS app with AWS Amplify Hosting

Collapse
zural profile image
Shiva

Hi Developers,

I have problem in next rewrite rules,
(working) example.com --> index.html
(not working) example.com/country --> /pages/[country]/index.html
(not working) example.com/country/city --> /pages/[country]/[city]/index.html

My configuration in rewrite rules,

[
    {
        "source": "/<*>",
        "target": "/index.html",
        "status": "404-200",
        "condition": null
    },
    {
        "source": "/<*>/",
        "target": "/pages/[country]/index.html",
        "status": "200",
        "condition": null
    },
    {
        "source": "/<*>/<*>/",
        "target": "/pages/[country]/[city]/index.html",
        "status": "200",
        "condition": null
    }
]
Enter fullscreen mode Exit fullscreen mode

Ref code repo : github.com/hosseinAMD/next-playground

Help me to fix this !!

Collapse
jrosales90 profile image
Juan Antonio

Hi! Did you can resolve this fix?