0

我有一个网站:

http://www.test.com/?city=beijing&category=1

http://www.test.com/?city=beijing&category=1&start=36

http://www.test.com/?city=beijing&category=1&start=72

http://www.test.com/?city=beijing&category=2

http://www.test.com/?city=beijing&category=1&start=36

http://www.test.com/?city=beijing&category=1&start=72

http://www.test.com/?city=beijing&category=1&keyword=test

http://www.test.com/?city=beijing&keyword=test&start=36

http://www.test.com/?city=beijing&keyword=test&start=72

http://www.test.com/?city=beijing

http://www.test.com/?city=beijing&start=36

http://www.test.com/?city=beijing&start=72

如果我想将其重写为 http://www.test.com/beiing/1/36

谁能告诉我在 .htaccess 文件中写入的代码。?

4

1 回答 1

0

您需要系统化,在这种情况下,参数的顺序很重要:

# ...
RewriteRule /([a-z]+)/([0-9]+)/([0-9]+) ?city=$1&category=$2&start=$3
# ...
于 2013-03-18T15:49:24.303 回答