How to Remove index.php from Magento URLs
1) Let’s Change a Setting, Admin
The first thing you need to do is to login to your Magento admin panel (index.php/admin) in order to change a very simple setting which will let Magento know that you intend to use URL rewriting throughout your store rather than their ugly default URLs.
Login, and change this setting:
Go to System > Configuration > Web > Search Engine Optimization
Use Web Server Rewrites: YES
That was easy, wasn’t it? Okay, now for the final step.
2) Let’s Use a .htaccess File to Rewrite the URLs
The final step involves creating a .htaccess file in the Magento installation folder in order to compliment the settings you changed within your admin settings earlier, and this will actually rewrite the URLs. Choose the applicable .htaccess version below.
If your Magento store is installed in root (public_html), use this:
The first thing you need to do is to login to your Magento admin panel (index.php/admin) in order to change a very simple setting which will let Magento know that you intend to use URL rewriting throughout your store rather than their ugly default URLs.
Login, and change this setting:
Go to System > Configuration > Web > Search Engine Optimization
Use Web Server Rewrites: YES
That was easy, wasn’t it? Okay, now for the final step.
2) Let’s Use a .htaccess File to Rewrite the URLs
The final step involves creating a .htaccess file in the Magento installation folder in order to compliment the settings you changed within your admin settings earlier, and this will actually rewrite the URLs. Choose the applicable .htaccess version below.
If your Magento store is installed in root (public_html), use this:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]If your Magento store is installed in a subfolder (public_html/shop), use this:RewriteEngine On
RewriteBase /shop/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /shop/index.php [L] – hope that helps!--
Comments
Post a Comment