我在这里尝试做两件事..
- 将http://site.com.au/brand.php?pBrand=THENORTHFACE重定向到http://site.com.au/brand/the-north-face (这工作正常)
- 将http://site.com.au/listingbrand.php?pBrand=THENORTHFACE重定向到http://site.com.au/brand/the-north-face (这不起作用,当重定向 listingbrand.php?pBrand= DOSH 或 pBrand=ATKM,它们都指向第一次重写 the-north-face)。
我如何使每个品牌的第二次重写工作?另外,为每个品牌重复重写是否正确?
RewriteCond %{QUERY_STRING} ^pBrand=THENORTHFACE$ [NC]
RewriteRule ^brand\.php$ /brand/the-north-face/? [R=301,L]
RewriteRule ^listingbrand\.php$ /brand/the-north-face/ [R=301,L]
RewriteCond %{QUERY_STRING} ^pBrand=DOSH$ [NC]
RewriteRule ^brand\.php$ /brand/dosh/? [R=301,L]
RewriteRule ^listingbrand\.php$ /brand/dosh/ [R=301,L]
RewriteCond %{QUERY_STRING} ^pBrand=ATKM$ [NC]
RewriteRule ^brand\.php$ /brand/all-the-kings-men/? [R=301,L]
RewriteRule ^listingbrand\.php$ /brand/all-the-kings-men/ [R=301,L]