.htaccess 301重定向OpenCart

.htaccess 301重定向OpenCart,.htaccess,redirect,.htaccess,Redirect,大家 如何使301从url重定向成为可能 /index.php?_car_=product&filtr[make]=6 到 我尝试使用下面的代码,但它不起作用 RewriteCond %{THE_REQUEST} ^GET\ /index\.php\?_car_=product&filtr[make]=6 [NC] RewriteRule ^index.php$ /catalog/make/audi? [R=301,L] 您的问题是[和]是regex特殊字符,您需要使用反斜杠

大家

如何使301从url重定向成为可能

/index.php?_car_=product&filtr[make]=6

我尝试使用下面的代码,但它不起作用

RewriteCond %{THE_REQUEST} ^GET\ /index\.php\?_car_=product&filtr[make]=6 [NC]
RewriteRule ^index.php$ /catalog/make/audi? [R=301,L]

您的问题是[]是regex特殊字符,您需要使用反斜杠来逐字匹配特殊字符,以逃避特殊字符,请尝试:

RewriteEngine on
RewriteCond %{THE_REQUEST} ^GET\ /index\.php\?_car_=product&filtr\[make\]=6 [NC]
RewriteRule ^ /catalog/make/audi? [R=301,L]
RewriteEngine on
RewriteCond %{THE_REQUEST} ^GET\ /index\.php\?_car_=product&filtr\[make\]=6 [NC]
RewriteRule ^ /catalog/make/audi? [R=301,L]