0
我在那里我试图消除某些网址中的子目录的情况下删除子目录。mod_rewrite的某些网址中
这里就是我试图完成
http://www.example.com/shop/some_product应该去http://www.example.com/some_product
但
我需要http://www.example.com/shop/customer/account保持不变。
所以基本上我需要重写任何店/ ...除了店/客户/ ...店/管理/...
这是我曾尝试
RewriteCond %{REQUEST_URI} !^/shop/customer
RewriteCond %{REQUEST_URI} !^/shop/admin
RewriteCond %{REQUEST_URI} !^/shop/sales
RewriteRule ^/shop/(.*) http://www.example.com/$1 [L]
任何人有什么建议吗?
看起来不错,只是你缺少初始'RewriteEngine叙述on'。 – arkascha
并且'RewriteRule'中的前导斜杠'^ /'是否正确取决于放置该规则的_where_。 – arkascha