X

FILL IN YOUR DETAILS NOW AND WE WILL BE IN TOUCH.

X
  • Please Select
Elemental Back to Listing

Your website and Google – URLS and Content Serving

  DEALING WITH AJAX 

Many web developers are afraid of using AJAX content, let alone AJAX pages or even completely AJAX driven sites. For fear that their pages would not be properly indexed or even penalized. These fears, however, are completely unfounded. Which is great, because AJAX is a marvelous tool for making websites fast and responsive.

As most HTML developers already know, when dealing with pages using AJAX content, the # tag can be used in the URL to ‘save’ different page states, for example {www.mysite.com/news.htm#page2}. To make Google aware of this page-state, make sure there is a link to it somewhere, using the following syntax {www.mysite.com/news.htm#!page2}. Note the inclusion of the exclamation mark.

Now Google is aware of it and indexes the page in the current state. All that remains is to find a way to access this page from search results. Unfortunately, the # tag is not usable by servers. Google’s solution to this is to call the following URL {www.mysite.com/news.htm?_escaped_fragment_=page2} instead. Google simply swaps out the #! with the query string parameter called _escaped_fragment_.

All we have to do is detect the escaped_fragment parameter on our server and serve up the ‘page2′ version of the news.htm, pre-rendered.

Google’s webmaster guide tells us that this system will behave like normal indexing and not affect page ranking, so no need to worry. In fact, it is worth noting that twitter uses this system.

  DEALING WITH MOBILE 

Responsive design is the number one recommendation for dealing with different types and sizes of devices on your site. This is mainly due to a lot of variations and that user agent sniffing is usually error prone.

This works fine, except when you get down to older phones that are too low on resolution or don’t support the necessary media queries in the CSS. For these devices, you have no choice but to serve different content. There are two acceptable approaches to doing this:

a.   One is to use User-Agent sniffing and serve different content (for the older device) on the exact same URL. Google has no problem with this as long as you include the following header: ‘Vary: User-Agent’. This tells Google that the following URL will sometimes serve a ‘mobile’ version of the page.

b.   The second solution is to redirect to a different URL for older mobile visitors. The recommended approach for this is not to redirect to the mobile home page, but rather to a mirrored sites page. For example the following page {www.mysite.com/products.htm} will go to this page {mobi.mymobilesite.co.za/products.htm}.

As many pages as possible should redirect to their mobile counterparts and if needed vice versa. 

This will explain to Google the relationship and reason for the redirect and therefore will not impact your page rank. (Please note that due to the use of canonical, the main page will be used when determining page rank). Also, as before, you will need your server to serve up the ‘Vary: User-Agent’ header.

Here at Elemental Web Solutions, we make use the latest technologies and features when designing and developing websites for our clients. This ensures that these websites not only look great and work well from a usability point of view but that they also play nicely with Google and other search engines.



Contact us today to discuss your company’s unique requirements.