This is how ajax google and bing calls are handled.
The documentation is mentioned here.
The overview mentioned in the documents is as follows
the crawler finds a pretty AJAX URL (that is, a URL containing a hash fragment #!). It then requests the contents of this URL from your server in a slightly modified form. Your web server returns the content as an HTML snapshot, which is then processed by the crawler . search results will display the original URL .
A step-by-step guide is shown in the docs.
Since Angular JS is intended for the Client side , therefore, you need to configure the web server to call the headless html browser to access your web page and deliver the hashbang URL that will be assigned to the google special URL .
If you use the hashbang url , you need to specify the angular application to use them instead of the normal hash of the value
App.config(['$routeProvider', '$locationProvider', function($routes, $location) { $location.hashPrefix('!'); $routes.when('/home',{ controller : 'IndexCtrl', templateUrl : './pages/index.html' });
as indicated in the sample code here
However, if you do not want to use the hashtag url , but still tell google about the html content , but still want to inform Google about it, you can use this meta tag as this
<meta name="fragment" content="!" />
and then configure angular to use htmlURL
angular.module('HTML5ModeURLs', []).config(['$routeProvider', function($route) { $route.html5Mode(true); }]);
and then no matter what method is installed through the module
var App = angular.module('App', ['HashBangURLs']); //or var App = angular.module('App', ['HTML5ModeURLs']);
Now you need a browser without a browser to access the URL. You can use phantom.js to load the contents of the page, run javascript , and then transfer the contents to a temporary file.
Phantomrunner.js , which takes any URL as input, loads and parses the html in the DOM, and then checks the status of the data.
Check each page using a specific function here.
SiteMap can also be done as shown in this example.
Best feature - you can use the search console to check the URL of your site using
Google search console
Full attribution goes to the site and the author mentioned in this site
.
UPDATE 1
Your crawler needs pages like -
- com/ - com/category/ - com/category/page/
By default, however, angular sets your pages as such:
- com - com/#/category - com/
Approach 1
Hash bang lets angular know which HTML elements need to be injected using JS, which can be executed as mentioned earlier, but since it has been removed, therefore, another solution would be the following
Configure $locationProvider and configure the base for relative links
This allows angular to change the routing and URLs of our pages without refreshing the page.
- Set the base and head of the document as
<base href="/">
The location service will automatically switch to the hashbang method for browsers that do not support the HTML5 history API.
Full attribution goes to the page and the author
You can also note some other measures and tests that you can take care of, as indicated in this document.