-1

I am unable to reload my website when refresh from browser in angular 2

  1. I don't want hash '#' symbol in url thus remove it from routing use hash
  2. redirect to same page from app.component from getting active url

Not Found The requested document was not found on this server. Web Server at someserver.com

Prasanjit
  • 21
  • 4

2 Answers2

1

Sounds like you need to config on the server that every route will be responses with the index.html.

Eliran Eliassy
  • 1,590
  • 12
  • 25
  • I am using angular 2 routing with app_initializer which is fetching data from DB for dynamic route collection – Prasanjit Jun 17 '19 at 13:07
0

1) For remove, hash please check this

2) For reloading issue, You have two options.

I) Use .htaccess and set the path in that 
II) Allow you dist folder from node. 

Smple .htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /{{project folder name}}/ [NC,L]
Sachin Shah
  • 4,503
  • 3
  • 23
  • 50