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

change

#LoadModule rewrite_module modules/mod_rewrite.so

to

LoadModule rewrite_module modules/mod_rewrite.so

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 🙂

Advertisements

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

  1. www.mahresult.nic.in says:

    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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s