Php 无法在Magento中htaccess中重定向的代码后展开类别
我已经为我的Magento站点在Php 无法在Magento中htaccess中重定向的代码后展开类别,php,apache,.htaccess,magento,mod-rewrite,Php,Apache,.htaccess,Magento,Mod Rewrite,我已经为我的Magento站点在System->Configuration->Web->Search Engine Optimization为“Web服务器重写”设置了yes。在url中没有index.php的情况下,它对SEO友好的url很有效,但如果使用index.php手动输入url,则它不会重定向url,从而删除index.php,为此,我在.htaccess文件中添加了以下两行: 重写cond%{THE_REQUEST}^[A-Z]{3,}\s/+index.php(/[^\s\?]+
System->Configuration->Web->Search Engine Optimization
为“Web服务器重写”设置了yes
。在url中没有index.php的情况下,它对SEO友好的url很有效,但如果使用index.php手动输入url,则它不会重定向url,从而删除index.php,为此,我在.htaccess
文件中添加了以下两行:
重写cond%{THE_REQUEST}^[A-Z]{3,}\s/+index.php(/[^\s\?]+)?[北卡罗来纳州]
重写规则^%1/[L,R=301]`
在此之后,它还会从手动输入的URL中删除index.php。所以,这个问题得到了解决
但现在我在后端面临这个问题。我无法扩展类别,有时我无法登录管理
请尽快建议解决方案我得到了这个解决方案,我将下面的代码放在了.htaccess中,并解决了我的问题
RewriteRule ^(.*)(index.php/admin)($|/) - [L]
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.example.com/$1 [R=301,L]
RewriteRule ^index.php/(.*) $1 [R=301,QSA,L]