0
RewriteRule ^shop _new_shopAll.php [NC]
RewriteRule ^shop/new _new_shopNew.php [NC]
RewriteRule ^shop/swarovski _new_shopSwar.php [NC]
RewriteRule ^shop/signature _new_shopSig.php [NC]
RewriteRule ^shop/wedding _new_shopWedding.php [NC]
RewriteRule ^shop/celeb _new_shopCeleb.php [NC]
RewriteRule ^shop/sale _new_shopSale.php [NC]
RewriteRule ^shop/sw3 _new_shopSW3.php [NC]

我似乎没有意识到为什么商店可以正常工作而其他一切都可以正常工作?是否需要添加 $ 或 $1?

我想让这个工作

/shop?filter=Black = /_new_shopAll.php?filter=Black
/shop/celeb?filter=Black  = /_new_shopCeleb.php?filter=Black
/shop = /_new_shopAll.php
/shop/celeb = /_new_shopCeleb.php

这些是单独的链接。

4

1 回答 1

1

在任何其他重写有机会触及链接之前,您的第一条规则RewriteRule ^shop _new_shopAll.php [NC]也将匹配并替换链接。shop/new之后的所有 RewriteRules 改为参见_new_shopAll.php.

您需要$像这样在第一条规则的末尾添加一个: RewriteRule ^shop/?$ _new_shopAll.php [NC] 这样它就不会匹配shop/new,而其他规则将有机会匹配它。

于 2012-10-19T09:05:22.043 回答