Mobile app version of vmapp.org
Login or Join
Kristi941

: Google only index main page My site is a single page application built using AngularJS. My aim is to make it crawl-able (https://developers.google.com/webmasters/ajax-crawling/docs/specification). This

@Kristi941

Posted in: #CrawlableAjax #Seo #SinglePageApplication

My site is a single page application built using AngularJS. My aim is to make it crawl-able (https://developers.google.com/webmasters/ajax-crawling/docs/specification).

This is what I have been using:-


Pages without hash fragments
AngularJS configured to use HTML5 URLs
<meta name="fragment" content="!" /> inserted to the head


As mentioned in the specification, using the above method, crawler is able to read my URL,
domainname.com as domainname.com?_escaped_fragment_=
My URL looks like this:

http;//www.domainname.com/about

Forwarded the request if request include _escaped_fragment_ to my htmlfiles directory

RewriteEngine On

Options +FollowSymLinks

RewriteCond %{QUERY_STRING} ^_escaped_fragment_=$
RewriteRule ^(.*)$ /htmlfiles/index.html? [NC,L]

RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule ^(.*)$ /htmlfiles/%1.html? [NC,L]

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ / [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]


With the above rewrites desired html files were able to be obtained as follows:-
domainname.com?_escaped_fragment_= receives domainname.com/htmlfiles/index.html
and
domainname.com/?_escaped_fragment_=about receives domainname.com/htmlfiles/about.html
Note: these tests were carried out by disabling javascript on browser

The sitemap submitted to Google is as shown:

<url>
<loc>http://www.domainname.com/</loc>
</url>
<url>
<loc>http://www.domainname.com/about</loc>
</url>


Problem

What Google did is that it only index my main page domainname.com correctly.
However it does not index other pages, in this case, domainname.com/about.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Kristi941

2 Comments

Sorted by latest first Latest Oldest Best

 

@Odierno851

It's impossible to tell without looking at your site, but I think you're using the AJAX crawling scheme incorrectly.

If you have example.com/about and add the fragment meta tag to that page (so when you curl example.com/about it returns the meta tag in the response), then the URL that would be fetched for indexing would be example.com/about?_escaped_fragment_= , not example.com/?_escaped_fragment_=about .

10% popularity Vote Up Vote Down


 

@Smith883

Consider using HTML5, CSS3, and pushstate. Here are a few resources and examples:

html5.gingerhost.com/ http://www.ocpsoft.org/java/seo-friendly-angularjs-with-html5-pushstate-rewrite-and-twelve-lines-of-code/

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme