app.component.html
I spent a lot of time on solving this problem and unfortunately I don’t know how to solve it. When I check my application for Seo on for example www.seoptimer.com and everytime Seo does not see my sub-pages.
Could someone explain me what I’m doing wrong? Is the problem with my Routing file or .htaccess?
2
Answers
The tool you are using is probably just not able to render JavaScript driven sites (Google is).
Don’t worry too much about SEO Tool xy. Publish your site, use Googles Webmastertools and check in Google SERPs by using “site:https://www.example.com” if you have reached the index.
Also, make sure to add a robots.txt and a sitemap file:
https://www.thecodecampus.de/blog/angular-cli-sitemap-robots-txt/
At the moment, GoogleBot is not able to crawl an Angular website since it uses Chrome 41 engine which is pretty old and doesn’t even support ES6 (e.g: it doesn’t support arrow functions).
If you can wait for it, Google is working on using the latest Chrome engine version and it should be released early 2019.
If you can’t wait for the new GoogleBot, then the solution is Angular Universal. This is an optional package from the Angular framework that enables server side rendering (and thus the “crawlability” of your website for any search engine) at the cost of some minor refactoring in your app, and the use of Node.js to serve the app. The refactoring includes: