我想像我这样设置我的htaccess:
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+) index.php?slash1=$1&slash2=$2&slash3=$3&slash4=$4 [NC]
但保留某些不应受上述影响的目录,例如domain.com/banana应该只使用domain.com/banana而不是index.php使用slash1 = banana。
答案 0 :(得分:0)
只需像这样添加RewriteCond:
RewriteCond %{REQUEST_URI} !^/(banana|oranges|apple)(/.*|)$ [NC]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+) index.php?slash1=$1&slash2=$2&slash3=$3&slash4=$4 [NC,L]