1

I followed this answer to make my AngularJS indexed by Google. As discussed on the answer, I Added $locationProvider.html5Mode(true) to my routing system. It also say that I should deliver the pages when they are requested directly to the server. for example /forum should be responded with the forum page. The problem is that I do not have a forum page to send. I am using ng-route so I have a main-view div that switched content when the client changing pages.

Since I do not have any html pages instead the index.html, what should I send back when the server receive a request to a page (/forum) ?

My current solution is to send a redirection to /#/forum, this way the client does receive the forum page (since the Angular routing system is automatically redirects the page to the forum page, and the HTML5 is changing the url to /forum).

But this way, Google does not indexes my /forum page, becuase when the crawler request the page it receives a redirection to /#/forum and the crawler ignores everything after the #.

What is the right way to handle this situation ? How can I make Google fully index my angularJS app ? The only page that it does index is the / page.

Community
  • 1
  • 1
Gil
  • 97
  • 2
  • 10

0 Answers0