我不确定如何将动态网址重新编写为另一种动态网址?
我想改变:
/blog/category.php?catseourl=ExampleCat&pn=1
/blog/category.php?catseourl=ExampleCat&pn=2
/blog/category.php?catseourl=ExampleCatTwo&pn=1
分为:
/blog/category/ExampleCat/1
/blog/category/ExampleCat/2
/blog/category/ExampleCatTwo/1
我已经到了这一步:
RewriteRule ^blog/category/([^/]*)$ /blog/category.php?catseourl=$1&pn=$1 [L]
但我不确定如何将动态更改添加到重写的左侧?
感谢您的帮助。
答案 0 :(得分:1)
尝试
RewriteRule ^blog/category/([^/]+)/([0-9]+)/?$ /blog/category.php?catseourl=$1&pn=$2 [L]
答案 1 :(得分:0)
RewriteEngine On
RewriteRule ^blog/category/([^/]*)/([^/]*)/?$ /blog/category.php?catseourl=$1&pn=$2 [L]
答案 2 :(得分:0)
试试这个:
RewriteRule ^blog/category/(.+)/([0-9]+)$ /blog/category.php?catseourl=$1&pn=$2 [L]