Angular page not found when it's refreshed -
this question has answer here:
i faced strange issue while deploying angular project on local server. built project , copied webserver folder can accessed using: http://localhost/angular/
base href
set , app working fine. when click link, it's working, ex: http://localhost/angular/apartments
if refresh, it's gone 404
error showing.
if server apache create file name of .htaccess
paste data
<ifmodule mod_rewrite.c> options indexes followsymlinks rewriteengine on rewritebase /myappdirectory/ rewriterule ^index\.html$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.html [l] <--- index.html file path starting public html folder </ifmodule>
update last line according command
save , refresh page. luckily page works
for iis server follow link
http://jasonwatmore.com/post/2017/02/24/angular-2-refresh-without-404-in-node-iis
Comments
Post a Comment