The Dreaded index.php!
February 29, 2012
A lot of people get the very annoying problem in Magento where “index.php” shows up in their URLs. If you try to type in “store.com” the page will load as “store.com/index.php”. This happens on sub-pages too; if you go to a product or category you’ll see “store.com/index.php/widgets/gizmo.html”.
Magento Web Server Rewrites
.htaccess AllowOverride_All and RewriteBase
On your server you should find an important file labeled “.htaccess“. This file controls certain aspects of how your site is displayed, loaded, and interacted with. You want to make sure you have two lines in this file and that neither is preceded with a “#” (which is a way of commenting out a line of code from being active). Open up this file and make sure that AllowOverride_All is present and that RewriteBase is both present and followed by the directory where you have Magento installed (i.e. “/” for a root directory installation or something like “/store/” if you site is set up at exmample.com/store).
One other thing to note, your server can have multiple .htaccess files depending on how Apache was installed and configured. Do a search on your system to make sure that any other .htaccess files (sometimes found in various subdirectories) have the above settings as well.
Remember to clear the cache from Magento and your browser as well as restart Apache to ensure all your changes have taken effect and you should hopefully be free of index.php!
The Commative Team