此页面上的第5条规则由URL触发:/vehicles/Ford/Escape/2005/
但是它被第9条规则重写,我无法弄清楚原因。我已经查找了htaccess标志,L
如果我正确地理解了我已经拥有的那些,就应该这样做。
#urls carried over from previous versions of the site
RewriteRule ^vehicles/([^/]+)/([^/]+)/([^/]+)/([0-9]+)$ /index.php?cmd=store&sec=product&act=view&id=$4&make=$1&model=$2&year=$3&%{QUERY_STRING} [L,NC]
RewriteRule ^vehicles/([^/]+)/([^/]+)/([^/]+)$ /index.php?cmd=store&sec=product&act=list&make=$1&model=$2&year=$3&%{QUERY_STRING} [L,NC]
RewriteRule ^vehicles/([^/]+)/([^/]+)$ /index.php?cmd=vehicle&sec=make&subsec=model&tiersec=year&act=list&make=$1&model=$2&%{QUERY_STRING} [L,NC]
RewriteRule ^vehicles/([^/]+)$ /index.php?cmd=vehicle&sec=make&subsec=model&act=list&make=$1&%{QUERY_STRING} [L,NC]
RewriteRule ^vehicles/$ /index.php?cmd=vehicle&sec=make&act=list&%{QUERY_STRING} [L,NC]
#lets not break the old vehicle search URL
RewriteRule ^vehicle_search/$ /vehicle/search/ [R=301]
#But fix the ones that need fixing (new standard format)
RewriteRule ^([^/]+?)/([^/]+?)/([^/]+?)/([^/]+?)/([^/]+?)/([^/]+?)/?$ /index.php?cmd=$1&sec=$2&subsec=$3&tiersec=$4&quadsec=$5&act=$6&%{QUERY_STRING} [L,NS]
RewriteRule ^([^/]+?)/([^/]+?)/([^/]+?)/([^/]+?)/([^/]+?)/?$ /index.php?cmd=$1&sec=$2&subsec=$3&tiersec=$4&act=$5&%{QUERY_STRING} [L,NS]
RewriteRule ^([^/]+?)/([^/]+?)/([^/]+?)/([^/]+?)/?$ /index.php?cmd=$1&sec=$2&subsec=$3&act=$4&%{QUERY_STRING} [L,NS]
RewriteRule ^([^/]+?)/([^/]+?)/([^/]+?)/?$ /index.php?cmd=$1&sec=$2&act=$3&%{QUERY_STRING} [L,NS]
RewriteRule ^([^/]+?)/([^/]+?)/?$ /index.php?cmd=$1&act=$2&%{QUERY_STRING} [L,NS]
答案 0 :(得分:1)
不,第五条规则不会由您显示的网址触发。该规则旨在仅捕获vehicles/
。
第9条规则确实是第一条匹配的规则。
你必须扩展第二条规则来处理斜杠。