refreshing the page results in 404 error- Angular 6

后端 未结 10 1780
广开言路
广开言路 2020-12-05 06:54

I am building an application with the help of Angular6 and facing problems in routing. All the routes are working when I click on a particu

10条回答
  •  悲&欢浪女
    2020-12-05 07:29

    If you are using cpanel then it is easy to solve this issue.

    Go to Advanced Options

    Step 1: Go to Error Pages.

    Step 2: Copy your index.html code and paste it in 404.shtml.

    That's it technically all your routes are redirected to index.html file. That's what angular wants :) and everything will work normal.

    Here are some reference links

    Namecheap Error Page Config

    Godaddy Error Page config

提交回复
热议问题