Gatsby Js 直接打开页面时将所有页面重定向到index页面

Gatsby Js redirects all pages to index page when the page is opened directly

我在 Gatsby Js 中有一个网站。我已经将它部署到 AWS Amplify。

当我尝试直接打开一个页面时,比如说 /pricing,它正在重定向到主页。当我点击链接到该页面的任何标签时,我能够打开该页面。

以下是我的 AWS Amplify 构建设置:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm install -g gatsby-cli
        - npm install
    build:
      commands:
        - gatsby build
  artifacts:
    baseDirectory: public
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

任何问题可能出在哪里的线索?

对于那些可能面临同样问题的人。它已通过仔细检查 AWS Amplify 重定向规则得到修复。