Jump to content

Friendly URLs for pagination


Recommended Posts

Hello,

 

Maybe this question is very obvious or it's already answered but I can't find the solution...

 

How can I change the URLs for pagination so they display the page number in a friendly way? Example:

 

Prestashop default URL:

 

http://demo-store.prestashop.com/en/10-furniture?p=2

 

 

Desired URLs:

 

http://demo-store.prestashop.com/en/10-furniture/page/2

 

or

 

http://demo-store.prestashop.com/en/10-furniture/page-2

 

 

I'm using Prestashop 1.5.5.0.

 

Thanks in advance.

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

Hello Orange35,

 

thanks for your response but I don't see how it can help... I'm already using friendly URLs but with pagination, the page parameter shows in a non friendly way:

 

http://demo-store.prestashop.com/en/10-furniture?p=2

 

I need to change the format of the URL to get one of these:

 

http://demo-store.prestashop.com/en/10-furniture/page/2 or http://demo-store.prestashop.com/en/10-furniture/page-2

 

Thanks again for your time.

Link to comment
Share on other sites

I have not tried this, but you can have a look at the category rule of the dispatcher

		'category_rule' => array(
			'controller' =>	'category',
			'rule' =>		'{id}-{rewrite}',
			'keywords' => array(
				'id' =>				array('regexp' => '[0-9]+', 'param' => 'id_category'),
				'rewrite' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'meta_keywords' =>	array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'meta_title' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*'),
			),
		),

Maybe something like this:

		'category_rule' => array(
			'controller' =>	'category',
			'rule' =>		'{id}-{rewrite}{page:/}{p}',
			'keywords' => array(
				'id' =>				array('regexp' => '[0-9]+', 'param' => 'id_category'),
				'rewrite' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'meta_keywords' =>	array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'meta_title' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*'),
                                'p' =>				array('regexp' => '[0-9]+', 'param' => 'p'),
			),
		),

Again, I've not tested this

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
  • 7 months later...

I have not tried this, but you can have a look at the category rule of the dispatcher

		'category_rule' => array(
			'controller' =>	'category',
			'rule' =>		'{id}-{rewrite}',
			'keywords' => array(
				'id' =>				array('regexp' => '[0-9]+', 'param' => 'id_category'),
				'rewrite' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'meta_keywords' =>	array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'meta_title' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*'),
			),
		),

Maybe something like this:

		'category_rule' => array(
			'controller' =>	'category',
			'rule' =>		'{id}-{rewrite}{page:/}{p}',
			'keywords' => array(
				'id' =>				array('regexp' => '[0-9]+', 'param' => 'id_category'),
				'rewrite' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'meta_keywords' =>	array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'meta_title' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*'),
                                'p' =>				array('regexp' => '[0-9]+', 'param' => 'p'),
			),
		),

Again, I've not tested this

In that file you have to make these changes. I am interested and looking to change the url of the page? P = 2.

Thank you.

Link to comment
Share on other sites

  • 8 months later...

Hello,

 

I have a problem with Friend URL.   When I enable it the paginations goes to error ( error 404).

 

The URL's goes something like: http://www.mydomain.com/damas/bolsos/?p=2  

But if I disable Friendly URL then the paginations works fine .  The URL in that case is : http://www.mydomain.com/index.php?category_rewrite=bolsos&controller=category&p=2

 

How can I enable Friendly URL's and that the pagination works?  

 

I have PS 1.6.0.14

 

Thank you.

Link to comment
Share on other sites

  • 1 year later...

Hello Carceron and NemoPS,

 

I have this similar problem. When I enable URL Friendly, and navigate to some product category, I can go to page 1, but obtain 404 error from second page to final page.

 

The same occurs if I search for a product and click in the search result in order to open the product detail.

 

I have tried to renew .htaccess disabling and enabling URL Friendly after deleting that file, but the problem continues.

 

Can you help me?

 

Thanks a lot.

Link to comment
Share on other sites

×
×
  • Create New...