因此,我有以下urls
foo/
foo/abc/
foo/def/
foo/ghi/
foo/([a-zA-Z0-9\-]+)/我只想重写最后一个。前四个(路径段)是固定的。
if first path segment is "foo"
and we have a second path segment
and second path segment is not "abc"
and second path segment is not "def"
and second path segment is not "ghi"
then ^foo/([a-zA-Z0-9\-]+)/$ index.php?id=20&alias=$1 [L, QSA]发布于 2016-08-16 02:48:43
你可以使用负向先行。
RewriteEngine On
RewriteRule ^foo/((?!abc|def|ghi)[a-z0-9-]+)/$ index.php?id=20&alias=$1 [L,QSA]https://stackoverflow.com/questions/38960889
复制相似问题