/
404 issue for Angular 2 routing
404 issue for Angular 2 routing
Problem
Angular 2 does not use "#" for routing anymore. Instead, all the parameters are separated by "/" only.
A big issue about using "/" is that our browser sends a new GET request based on the URL entered in the browser's address bar. It raises a 404 issue since the file based on the entered URL cannot be located.
Solution
Need to set up rewrite rule in IIS:
- Install IIS Rewrite extension from http://www.iis.net/downloads/microsoft/url-rewrite#additionalDownloads
- In IIS Manager, find the site using Angular 2 routing. Click URL Rewrite
to add following rules :- cfiles_allow
client/(style/*|app/*|node_modules/*|index.html|index.cfm) - cfiles_stop
- cfiles_allow
client/(.*)
client/index.cfm
c. Allow desktopClient
(cfcs|css|desktopClient)/*
Related articles
http://stackoverflow.com/questions/34955493/angularjs-2-routing
http://blog.angular-university.io/angular2-router/
, multiple selections available,
Related content
Relative paths for templates and css in angular2
Relative paths for templates and css in angular2
More like this
Angular 2 browser cache cleaning issue
Angular 2 browser cache cleaning issue
More like this
Error to run the angular2-quickstart
Error to run the angular2-quickstart
More like this
Trace failed requests on IIS
Trace failed requests on IIS
More like this
TypeScript file is empty in Chrome dev tool
TypeScript file is empty in Chrome dev tool
More like this
IIS Logs Related
IIS Logs Related
More like this