Ad

Angular 8 Sitemap And Robots.txt

- 1 answer

i created an angular application using angular 8. I am working on referecing my website on Google. I have added a sitemap.xml and robot.txt at the route of the project however when i try to access the file in my browser by doing so :

https://blablawebsite.fr/sitemap.xml

The routing module is picking up the route and can't find the page. How can i make sure sitemap.xml and robots.txt are not picked by the routing module ?

Ad

Answer

You need to first look into converting your project to Angular Universal. Google and other search engine bots can't and won't navigate through your app because all of that happens after-the-fact.

Start Here: https://angular.io/guide/universal

A lot of people misunderstand how all of this works and get very far into their project before realizing the difference between a website and an SPA. No biggie, you can still get your angular app to rank with Server Side Rendering

Ad
source: stackoverflow.com
Ad