如何在.htaccess中从小写规则中排除管理员网址

时间:2017-02-15 14:22:21

标签: apache .htaccess magento

我需要在小写规则中排除管理员网址(index.php / admin /)

排除的示例网址: http://local.copy.com/index.php/admin/sales_shipment/index/key/c20735e30dccd35392a225501f0e35c81adfcf8ebb5b640fe52592500c00a9f3/

对于小写网址,我使用下一个规则

RewriteMap lc int:tolower
RewriteCond $1 [A-Z]
RewriteRule ^/?(.*)$ /${lc:$1} [R=301,L]

谢谢!

2 个答案:

答案 0 :(得分:0)

尝试这样,

RewriteMap lc int:tolower
RewriteCond %{REQUEST_URI} !^/index.php/admin(.*) [OR]
RewriteCond $1 [A-Z]
RewriteRule ^/?(.*)$ /${lc:$1} [R=301]

注意:我暂时没试过。

答案 1 :(得分:0)

RewriteCond %{REQUEST_URI} !^/index.php/admin(.*) [NC]
RewriteCond $1 [A-Z]
RewriteRule ^/?(.*)$ /${lc:$1} [R=301,L]