refreshing the page results in 404 error- Angular 6

后端 未结 10 1722
广开言路
广开言路 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:16

    With .htaccess you can try with following way also:

    
        RewriteEngine on
    
        # Don't rewrite files or directories
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^ - [L]
    
        # Rewrite everything else to index.html
        # to allow html5 state links
        RewriteRule ^ index.html [L]
    
    

提交回复
热议问题