Crazy Horse
asked on
pretty urls product pagination
I can't get the rewrite rule correct in order to create pretty url's with pagination.
This is my current rule for listing products within a category:
y/shirts
I want the pagination url after clicking on "2" for example, to be
mysite.com/product-categor y/shirts/p age/2
I tried this but it doesn't work and just looks wrong:
This is my current rule for listing products within a category:
RewriteRule ^product-category/([a-zA-Z-]+)$ category.php?slug=$1 [NC,L]
The result is something like mysite.com/product-categorI want the pagination url after clicking on "2" for example, to be
mysite.com/product-categor
I tried this but it doesn't work and just looks wrong:
RewriteRule ^product-category/([a-zA-Z-]+) category.php?slug=$1/page/([a-zA-Z-]+)$ pagination?=$1 [NC,L]
I get an internal server error.
ASKER
Thanks Julian. I tried that but I get a "not found" error. Perhaps the issue is now in my PHP?
for($page = 1; $page <= $number_of_pages; $page++) {
echo "<li><a href='product-category/$page_url/page/$page'>{$page}</a></li>";
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
That will pass any query string parameters to the original link to the rewritten one