当Magento在自己的文件夹中时,如何设置根.htaccess文件

时间:2012-02-13 22:28:27

标签: php apache .htaccess magento

我想将Magento安装到自己的文件夹/ magento中。但是当用户访问该网站时,我希望它只是“/”,“/ admin”,“/ catalog”等。相反,它显示/ magento,/ imagento / index.php / admin / imagento / index.php /目录。我也不想在URL中看到任何index.php。在SO上有关于此的一些信息,但代码示例不准确。

当你在这里时,你能帮我自己和其他Stack Overflow读者了解你提议的.htaccess是如何工作的吗?也许有评论?

AllowOverride All
DirectoryIndex magento/index.php
Redirect permanent /index.php/admin /admin
Redirect 301 /index.php/admin /admin
Redirect permanent /magento/index.php /
Redirect 301 /magento/index.php /

<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /magento
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /magento/index.php [L]
RewriteRule . /index.php [L]
</IfModule>

0 个答案:

没有答案