enable URL Rewrite for magento

来源:互联网 发布:linux安装eclipse 编辑:程序博客网 时间:2024/05/23 15:06

For hide index.php in Magento,we should start the URL rewrite function.

1.Start the module mod_write 

a2enmod rewrite

or 

sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load


2.Edit Apache configure file defaut and make Apache can recongnise file .htaccess under web root document

AllowOverride none to AllowOverride all


3.Edit .htaccess <IfModule mod_rewrite.c>

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


4.Goto magento admin page,and click system->configuration->web->search engines optimization ,set "Use Web Server Rewrites" to "Yes".

Click system->Index Management,.select all and choose "Reindex Data".


5.restart apache

原创粉丝点击