How do you add url to a page?

I'm building a website that contains sorting when navigating from page to page. Should I add the sorting parameter to the URL or keep it in a cookie for SEO so that the same page URL is linked to everytime?

  • The advantage of using a sorting parameter is that I can cache the entire page. Another option is to keep the page static by adding ajax calls for links that use the sorting algorithm, however this affects the ability to crawl the site for links I believe.

  • Answer:

    I'm assuming there's a default sorting order which is displayed to a first time user on page load.  Standard practice would be to have this version served by default and this version is available to even those visitors without javascript enabled (the default way in which the search engine robots crawl webpages). The ajax implementation you mention should work much better than appending the sorting parameters to the url. The search engine will crawl the page using the default sorting order as long as you implement the sorting update to the columns as ajax and not some funky iframe madness. Most MVC/CRUD frameworks handle what you're trying to do quite elegantly. Since you brought up caching without specifying the caching framework I can only give you a rather simple response in this regard.  The URL your ajax calls to get the resorted list of links should be possible to cache. As a value added note: If you want to allow users to link to a particular sorted order of links I would suggest doing so using #anchors.

Sam Peck at Quora Visit the source

Was this solution helpful to you?

Other answers

Another option, besides those you mention, is to use rel canonical so that link juice flows to the default version of the page regardless of the exact URL linked to. Using this approach will allow you to put sorting parameters in the URL as you mentioned for simplified caching. If you do go the ajax route be sure to read up on the SEO consequences and workarounds such as http://googlewebmastercentral.blogspot.com/2009/10/proposal-for-making-ajax-crawlable.html on the Google Webmaster blog.

Julias Shaw

I think keeping it in cookie is a better option, it will for sure help in SEO plus it will let your page URL a bit simple.

Abhishek Ahlawat

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.