How do I force redirect all 404's (or every page, whether invalid or not) to the homepage?

后端 未结 6 1445
孤街浪徒
孤街浪徒 2020-12-07 19:06

Currently every invalid page is 500 (Internal Server Error) because I probably messed up with my server block configuration.

I decided to shut down my website a whil

6条回答
  •  情书的邮戳
    2020-12-07 19:43

    Must use

    "fastcgi_intercept_errors on;"
    

    along with the custom redirect location like error_page 404 =200 /index.html or

    as above

    location @myownredirect {
      return 302 /;
    }
    

提交回复
热议问题