Remove index.php from Magento urls

akbaralmansoor placeholder

Remove index.php from Magento

In this article, we are going to see how to remove the index.php from the magneto URL on both frontend and backend. For example:

http://example.com/index.php/admin/ to http://example.com/admin/

Before you start make sure that the Apache rewrite module is enabled on your server or contact your hosting provider to enable this feature, most hosting providers enable this feature by default, and then follow the below  steps:

1) Log in to your administration area then go to ‘System > Configuration > Web‘.

2) Navigate to the ‘Unsecure’ and ‘Secure’ tabs. Make sure the ‘Unsecured’ and ‘Secure’ – ‘Base Url’ options have your domain name within it and do not leave the forward slash off at the end of the URL. Example: http://example.com/

3) While still on the ‘Web’ page, navigate to the ‘Search Engine Optimisation‘ tab and select ‘YES’ underneath the ‘Use Web Server Rewrites’ option.

4) Navigate to the ‘Secure’ tab again (if not already on it) and select ‘Yes’ on the ‘Use Secure URLs in Frontend’ option.

5) Now go to the root of your Magento website folder and use this code for your .htaccess:

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

Note: If you run/installed your Magento store in a subfolder (public_html/shop), use this: (in case of multi-store also) then add subfolder name in RewriteBase /subfolder/ (in 2nd line)

6) Now go to ‘System > Cache Management’ and select all fields and make sure the ‘Actions’ dropdown is set on ‘Refresh’, then submit


Leave a Reply