How to remove “index.php” from all urls in Magento

Magento by default uses index.php for routing to urls. It is because some time you are on shared hosting and your apache is not configured with url rewrites = on or even on dedicated server you don’t have configured apache to work with url rewrites.

To remove “index.php” from magento urls you need to turn on the url rewrites.

Dedicated Hosting

It is simple in dedicated hosting
Edit httpd.conf (apache configuration file) and un-comment following line by removing “;” or “#” from beginning of line.
for example


#LoadModule rewrite_module modules/


LoadModule rewrite_module modules/

Save the file and restart apache.

Shared Hosting

In shared hosting that is normally on, but if that is off then you need to contact your hosting provider to turn it on.

Magento Configuration

After making sure url rewrites are on, go to Magento backend >configuration >General >web
Look for “Search Engines Optimization” section

Remove index.php from urls
Remove index.php from urls

Look for “Use Web Server Rewrites” and select “Yes” from dropdown, Save the config and refresh the front page of your website, you will see index.php is removed from urls.

Enjoy 🙂

2 thoughts on “How to remove “index.php” from all urls in Magento

  1. Excellent blog! Do you have any hints for aspiring writers?
    I’m planning to start my own blog soon but I’m a little lost on everything.
    Would you propose starting with a free platform like
    Wordpress or go for a paid option? There are so many options out there that I’m totally confused ..

    Any suggestions? Appreciate it!

Leave a Reply

Your email address will not be published. Required fields are marked *