Skip to content

Rewrites and redirects do not work according to the documentation configuration for single pages. #1989

@faramir07

Description

@faramir07

Environment information

N/A

Describe the bug

I encountered an issue with the configuration of rewrites and redirects in my single-page application (SPA). Despite following the documentation, the routes are not handled correctly, leading to a 404 error when directly accessing any URL other than the root. The app is using React Router, and it should handle all routes client-side, but the server is not redirecting requests properly to the index.html file as expected.

This is how the project routes are configured
image

Reproduction steps

and this is the configuration that must be done according to the documentation
image.

Framework: React
Router: React Router v6.22.2
Hosting: AWS Amplify
Build Tool: Vite v5.0.8
Node.js Version: 20.11.1
Operating System: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    hostingIssue related to Amplify Hostingpending-responseIssue is pending response from authorpending-triageIncoming issues that need categorization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions