Jump to content

Modules-blocklayered of SEO unfriendly URL solution: [pjax-pushState-ajax]


Recommended Posts

http://localhost/prestashop/16014/en/8-dresses#color-black/properties-maxi_dress

The URL above will redirect to (301?)

http://localhost/prestashop/16014/en/8-dresses#/color-black/properties-maxi_dress

 

In the URL above is the blocklayered module
the URL for SEO is not that friendly
  1. Add redirect
  2. symbol #

 

But already plan to resolve the problem in the industry:
 

pjax = pushState + ajax

 

P.S.

 

Github.com also use pajax technology!!!

 

Achieve your goals

  1. Jump page (forward backward, clicks, etc) not to request the page
  2. URL of the page with a page that displays content (in accordance with people's understanding of the traditional Web)
  3. In browsers that do not support the falling level of the traditional Web page

 

Hope that official PrestaShop team will use a technology completely solve the ugly and does not meet the standards of SEO URL problem!
URL changed, but there is no page refresh!
  • 1.URL SEO friendly!
  • 2. user experience perfectly!
  • 3. save traffic, site respond quickly!
  • 4. for browsers that do not support this feature, automatically switches to the original feature good compatibility!
I wish you the best of luck!
 
References:
  1. https://github.com/defunkt/jquery-pjax
  2. http://html5doctor.com/history-api/
  3. http://www.ruanyifeng.com/blog/2013/07/how_to_make_search_engines_find_ajax_content.html
  4. http://www.cnblogs.com/flash3d/archive/2013/10/23/3384823.html
Edited by alicebob (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 6 months later...

Hello everybody,

the post is a bit old, but I would like to know if somebody found a solution to this problem?

 

I would like "real" (direct) url for the filters (without #), in order that these pages could be indexed by google, and that I could do links from others pages to the color pages for example...

 

I hope that someone can help me, because I think it's an important issue for SEO.

 

Thank you

Edited by SophieB (see edit history)
Link to comment
Share on other sites

  • 3 months later...

Hello! i have some quick guide for all, also i can do this as payment job if you need:

First you need inside file blocklayered.php change all hash '#' symbols on 'filter'
After you need inside file blocklayered change all hash "#" symbols on 'filter'

 

It is important, change the hash '#' only in those places that according to the link, since this symbol '#' may be responsible also for other things, such as an indication of the ID of element in the code.
 
After in file blocklayered in reloadContent() function you need find line with this code:

 

window.location.href = current_friendly_url;

 
And change on this code:

 

var url = window.location.href;
if(url.indexOf('filter') === -1){

} else {
   url = url.substr(0, url.indexOf('filter'));
}

window.history.replaceState(null, null, url + current_friendly_url);
Best regards,
Kerm
Link to comment
Share on other sites

  • 1 year later...

modules/blocklayered/blocklayered.php

find: 

 $type_filter['values'][$key]['link'] = $categorie_link........................

 

Replace this formule:

                    // Check if there is an non indexable attribute or feature in the url
                    foreach ($non_indexable as $value)
                        if (strpos($parameters, '/'.$value) !== false)
                            $nofollow = true;
                    if (!empty($parameters))
                    {
                        $type_filter['values'][$key]['link'] = $categorie_link.'?selected_filters='.ltrim($parameters, '/');

                    }
                    else
                    {
                        $filter_name = $_GET['selected_filters'];
                        $type_filter['values'][$key]['link'] = $categorie_link.'?selected_filters='.ltrim($parameters, '/').''.$filter_name.'#';

                    }
                    $type_filter['values'][$key]['rel'] = ($nofollow) ? 'nofollow' : '';
                }

 

Very simple and primitive but it works PrestaShop 1.6.1.17

 

 

Edited by adrian99 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...