지금까지 github pages를 사용하다가 처음으로 netlify로 배포를 했습니다.

그런데 404 에러가 나서 인터넷을 찾아보고 수정했습니다.

해결 방법

public폴더에 _redirects라는 파일을 만듭니다.

_redirects파일의 내용은 다음과 같이 작성합니다.

/* /index.html 200

커밋하면 에러가 사라집니다.

(저는 이것을 public이 아니고 가장 상위 폴더에 넣어뒀다가 안돼서 한참 헤맸습니다...)

출처 : https://answers.netlify.com/t/netlify-page-not-found-when-sharing-react-router-dom-based-links/11744

Last modified: 2022년 01월 18일

Comments

Write a Reply or Comment

Your email address will not be published.