如何从/ katalog / protein / api和/ katalog / protein / activelab重定向到katalog / protein /?ms | manufacturer = API和katalog / protein /?ms | manufacturer = ActiveLab。
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/katalog/(protein|gainer)/(api|activelab)/?$ /katalog/$1/?ms|manufacturer=$2 [L,QSA]
答案 0 :(得分:0)
您的代码看起来很好,只需从RewriteRule模式中删除前导斜杠。
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^katalog/(protein|gainer)/(api|activelab)/?$ /katalog/$1/?ms|manufacturer=$2 [L,QSA,NE,NC]