0

我不确定如何将动态 url 重写为另一种动态 url?

我正在寻求改变:

/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] 

但我不确定如何将动态更改添加到重写的左侧?

谢谢你的帮助。

4

3 回答 3

1

尝试

RewriteRule ^blog/category/([^/]+)/([0-9]+)/?$ /blog/category.php?catseourl=$1&pn=$2 [L] 
于 2013-04-24T11:50:23.650 回答
0
RewriteEngine On
RewriteRule ^blog/category/([^/]*)/([^/]*)/?$ /blog/category.php?catseourl=$1&pn=$2 [L]
于 2013-04-24T11:50:24.417 回答
0

试试这个:

RewriteRule ^blog/category/(.+)/([0-9]+)$ /blog/category.php?catseourl=$1&pn=$2 [L] 
于 2013-04-24T11:52:00.693 回答