1

I have this regular expression for mod_rewrite

RewriteRule ^([0-9]+)/(fr|ru|en)/([a-z]+|[0-9]+)/([x]+([a-z]+))/([y]+([a-z]+))/([z]+([a-z]+))$ /index.php?start=$1&lang=$2&cat=$3&sc=$4&ssc=$5&sssc=$6 [L]

But in case of link: http://example.com/4564/fr/gdgfdgbgdfgd/xfirst/ysecond/zthird

I have these values:

start=4564
lang=fr
cat=gdgfdgbgdfgd
sc=xfirst
ssc=first
sssc=ysecond

So problem in: ssc и sssc.

I've changed to:

sc - a
ssc - b
sssc - c

but nothing.

4

1 回答 1

2

如果你想要的是

start=4564
lang=fr
cat=gdgfdgbgdfgd
sc=xfirst
ssc=ysecond
sssc=zthird

然后删除[x]+, [y]+,之后的捕获[z]+。所以规则是

RewriteRule ^([0-9]+)/(fr|ru|en)/([a-z]+|[0-9]+)/([x]+[a-z]+)/([y]+[a-z]+)/([z]+[a-z]+)$ /index.php?start=$1&lang=$2&cat=$3&sc=$4&ssc=$5&sssc=$6 [L]
于 2012-12-07T09:14:21.990 回答