In my Angular 4 application, if I type a non-root path into the url as my first visit to the site (i.e. localhost:4200/projects
), my application is bootstrapped and the correct component is rendered to the screen in the browser.
However, once I serve the site through IIS, if I go to http://<my-domain>.com/projects
, I get a 404 error (not from my application) and the application is never bootstrapped.
How do I get a visit to a non-root path as the first visit to the site in production to recognize that the application is an Angular application and bootstrap the application for any path that is the root or beyond?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…