1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【React-Rouer】S3上でreact-router-domを利用したSPAで404エラー

Last updated at Posted at 2022-02-23

問題

Reactのページ遷移で404になる。

対応方法

S3単体でできます。
amazon s3から
→ {バケット名}
 →「プロパティ」
  →「静的ウェブサイトホスティング」(ページの下の方)
   →「編集」
    →「静的ウェブサイトホスティング」に"index.html"を記載

その他

apacheなどでも同じ問題が発生しますが、以下で表示されるようになります。

sudo vi /etc/httpd/conf.d/httpd.conf
#ErrorDocument 404 /missing.html
ErrorDocument 404 /index.html

apache再起動する

以上

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?