use*_*429 1 linux apache ubuntu magento
我在Linux上安装了Magento,但URL看起来有点搞笑.例如,当我指向浏览器时http://localhost/magento/,URL会自动更改为http://localhost/magento/index.php/看起来很奇怪,因为index.php文件不是目录.然后,例如,当我点击购物车时,我被重定向到:http://localhost/magento/index.php/checkout/cart/
我只是想知道是否有人知道如何摆脱/index.php/浏览器地址栏中定义的URL 中的中间位?
sudo a2enmod rewrite && sudo service apache2 restart将以下规则添加到.htaccessMagento根目录下的文件中:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /magento/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /magento/index.php [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)