Mobile app version of vmapp.org
Login or Join
Jennifer507

: Single-page-apps and alternate / canonical URLs for mobile websites I have a "normal" website and I am currently developing a mobile version of the site. Because of the complexity of the shown

@Jennifer507

Posted in: #CanonicalUrl #Jquery #Mobile

I have a "normal" website and I am currently developing a mobile version of the site. Because of the complexity of the shown information, I am using a separate domain (mysite.mobi) and no responsive solution. The site is built as a single-page-app using jQuery mobile.

The main workflow is that I am using a custom parameter attached to my main file (mysite.mobi/index.htm#forecast?location_id=1234). It will then fire an AJAX-request and fetch the content corresponding to the forecast for the location_id 1234. The desktop website URL would be something like mysite.com/forecast/1234.

Now I am thinking about how to get my mobile search results displayed in Google searches. According to their recommendations, I should use a link rel=alternate tag in the main page and add a link rel=canonical tag to the mobile site.

There is the problem - as I am using a single page webapp, I only have a single crawlable file on my mobile domain where I could add this tag. However I can not get this tag to reflect the correct location on my main site.

What are the best practices for using a single-page-app and canonical URLs?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jennifer507

1 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

Single page apps have a definite downside when it comes to SEO because there is only one landing page. There is no way for you to map crawlable urls one to one between your desktop and mobile sites the way that you have it configured.

You could try to make your AJAX site crawlable using Google's supported method. That would entail changing your mobile urls to mysite.mobi/index.htm#!forecast?location_id=1234 and supporting crawlable urls on the server side like mysite.mobi/index.htm?_escaped_fragment_=location_id=1234 Even Google's crawlable AJAX spec doesn't appear to detail how to set meta tags for you escaped_fragment pages, so canonical tags still wouldn't be supported.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme