我有四个文件:
store.php
- >作为所有产品的列表(分页为?pag = {page number})
category-listing.php
- >作为类别产品的列表,例如:?catid=1
(也有与store.php相同的分页)
subcategory-listing.php
- >列出子类别产品,例如:?subcatid=1
(已分页)
产品详情页面,
product-detail.php
- >将有产品名称和ID
这就是我想要的:
www.mysite.com/store/ or www.mysite.com/store/?pag=2
www.mysite.com/store/category/ or www.mysite.com/store/category/?pag=2
www.mysite.com/store/subcategory/ or www.mysite.com/store/subcategory/?pag=2
www.mysite.com/store/a-product-detail-1 -> product detail (title and id)
请记住,除了产品详细信息外所有其他文件都被分页为?pag = {pagenumber}
我该怎么做?
这是我到目前为止所获得的子类别,但分页不起作用
RewriteRule ^/store/%1? [R=302,L,NE]
RewriteCond %{THE_REQUEST} /subcategory\.php\?subcatid=([a-zA-Z0-9_-]+) [NC]
RewriteRule ^store/([a-zA-Z0-9_-]+)/?$ subcategory.php?subcatid=$1 [L,QSA,NC]