所以基本上我想创建一个看起来像这样的网站结构:
/panel/optional1/optional2/optional3/optional4/
我试过以下:
RewriteRule ^panel/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/?$ index.php?page=panel&e1=$1&e2=$2&e3=$3&e4=$4 [L,QSA]
RewriteRule ^panel/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/?$ index.php?page=panel&e1=$1&e2=$2&e3=$3 [L,QSA]
RewriteRule ^panel/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/?$ index.php?page=panel&e1=$1&e2=$2 [L,QSA]
RewriteRule ^panel/([a-zA-Z0-9]+)/?$ index.php?page=panel&e1=$1 [L,QSA]
但它效果不佳。
答案 0 :(得分:0)
好的,如您所知,请尝试此规则将所有4个合并到一个:
RewriteRule ^panel(?:/([^/]*)(?:/([^/]*))?(?:/([^/]*))?(?:/([^/]*))?)?/?$ /index.php?page=panel&e1=$1&e2=$2&e3=$3&e4=$4 [L,QSA]