5

How can i remove index.php from the URL in Magento.

For example the home page URL is: www.mydomain.com/index.php

I want to show : www.mydomain.com

So is there any way to do that in the Magento Admin Panel.

5 Answers 5

17

You can remove the index.php in the frontend URLs performing the following steps in Magento's admin section:

In System -> Configuration -> Web -> Search Engines Optimizations, select YES.

Edit the /installdir/.htaccess and uncomment the line:

RewriteBase /magento/

In my case the subdirectory Magento is in is called magento, so change it to your subdirectory path if it is different.

Sign up to request clarification or add additional context in comments.

3 Comments

In addition to above make sure you have mod_rewrite enabled in your Apache.
You may find this post useful in case you have existing links including index.php - this prevents all use of the index.php within the site Removing the index.php from your URL completely
3

You can remove the index.php in the frontend URLs performing the following steps:

Go to the admin section of Magento.

  1. In System -> Configuration -> Web -> Search Engines Optimizations, select YES.

  2. In System -> Configuration -> Web -> Secure -> Use secure URLs in the frontend, select YES.

  3. Edit the /installdir/apps/magento/htdocs/.htaccess and uncomment the line:

    RewriteBase /magento/

Comments

3

Login to the Magneto Admin portal. Go to System >> Configuration. Selects the option Web from the General left tab. Use the option Yes for the field Use Web Server Rewrites under the tab Search engines Optimization

Also check the answer to the post https://stackoverflow.com/questions/12234767/my-magento-pages-wont-work-unless-index-php-is-in-url

Comments

1

You can remove the index.php in the frontend URLs performing the following steps:

Go to the admin section of Magento.

In System -> Configuration -> Web -> Search Engines Optimizations, select YES.

Clear cache now see its work. if any case do notwork go to ftp

find the file in your root .htaccess

check this line it should be comment for example

RewriteBase/magento/

Replace with this code.

#RewriteBase /magento/

Comments

1

EX: Your Site URL is: http://localhost/my_site/demo1/

Then add this to (or create) .htaccess (/my_site/demo1/.htaccess)

RewriteEngine On
RewriteBase /my_site/demo1/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /my_site/demo1/index.php [L]

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.