You are here:  » question about navigation when list of products on several page

Support Forum



question about navigation when list of products on several page

Submitted by acom on Thu, 2010-03-25 11:31 in

Hi David
I hope you are doing well.
Just a little question, I can't see how you manage to get the page number in rewrite mode.

For instance :
http://www.webpricecheck.co.uk/category/Accessories/2.html
then the variable $q in url rewriting has the value :
/category/Accessories/2.html
but I don't see in "search.php" how you extract the page number.
Best regards,
Frédéric

Submitted by support on Thu, 2010-03-25 11:36

Hi Frédéric,

The corresponding rewrite rule is

RewriteRule ^category/(.*)/(.*).html$ search.php?q=category:$1:&page=$2&rewrite=1&%{QUERY_STRING} [L]

...which extracts the [page number].html and passes it to search.php in the &page= parameter, then at the top of search.php you will see:

  $page = (isset($_GET["page"])?intval($_GET["page"]):1);

...which is how it is extracted...

Cheers,
David.

Submitted by acom on Thu, 2010-03-25 15:28

Many thanks David, I wish I had seen it myself it but I was too focused on the wrong files..