[Netlify] 페이지 새로고침 시 Page Not Found 오류 해결

2023. 2. 6. 20:16·Trouble Shooting
반응형

netlify로 올려놓았던 프로젝트에서 페이지 새로고침 시 Page Not Found가 뜨는 오류가 발생했다.

public 폴더에 redirects 추가

public 폴더에 _redirects 라는 이름의 파일을 만들고 아래와 같은 내용을 작성해주면 된다.

public/_redirects

/*  /index.html  200

 

혹시 이 방법이 안된다면?

루트 디렉토리에 netlify.toml파일을 만들고 안의 내용을 아래와 같이 작성해주면 된다고 한다.

netlify.toml

    [[redirects]]
    from = "/*"
    to = "/index.html"
    status = 200

 

 

References

https://stackoverflow.com/questions/58065603/netlify-renders-404-on-page-refresh-using-react-and-react-router

 

반응형

'Trouble Shooting' 카테고리의 다른 글

[Github Actions] the process '/usr/bin/git' failed with exit code 128 해결  (0) 2023.02.21
[Nginx] 페이지 새로고침 시 Page Not Found 오류 해결  (1) 2023.02.07
inefficient regular expression complexity in nth-check  (0) 2023.01.26
[React] 여러 개 요소 return할 때 key값 지정하기  (0) 2022.12.19
[axios, jest] Cannot use import statement outside a module 에러 해결  (0) 2022.11.14
'Trouble Shooting' 카테고리의 다른 글
  • [Github Actions] the process '/usr/bin/git' failed with exit code 128 해결
  • [Nginx] 페이지 새로고침 시 Page Not Found 오류 해결
  • inefficient regular expression complexity in nth-check
  • [React] 여러 개 요소 return할 때 key값 지정하기
SH_Roh
SH_Roh
  • SH_Roh
    혼자공부끄적끄적
    SH_Roh
  • 전체
    오늘
    어제
    • 분류 전체보기 (159)
      • FE (39)
        • HTML, CSS (3)
        • Javascript (17)
        • React (11)
        • Next.js (4)
      • Network (1)
      • DevOps (4)
      • Git (1)
      • Trouble Shooting (24)
      • Algorithm (41)
        • Python (2)
        • Data Structure, Algorithm (7)
        • Problem Solving (31)
      • Education (23)
        • Elice AI Track (4)
        • Wanted Pre-Onboarding FE Co.. (19)
      • TIL (25)
      • Etc. (1)
        • 회고 (1)
        • 그냥저냥 (0)
  • 링크

    • Github
  • 인기 글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
SH_Roh
[Netlify] 페이지 새로고침 시 Page Not Found 오류 해결
상단으로

티스토리툴바