How to remove index.php from url in magento
Ans :
If you want to access your magento URL without index.php
for example:
http://domain.com/index.php/category
to
http://domain.com/category
then use the following steps
1) Login to admin section by using the URL
http://domain.com/index.php/admin
2) then go to “System >> Configuration >>Web >> Search Engines Optimization”
Use Web Server Rewrites : YES
3) Go to “System >> Configuration >>Web >>Secure”
Use secure URL Frontend: YES
4)Then create the .htaccess file under your the magento installed folder.
If the magento installed under document root ( /home/username/public_html) then add follogig rules into .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
and If the magento installed under /shop or directory then add the following rules into ” /home/username/public_html/shop/.htaccess ” file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /shop/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /shop/index.php [L]
</IfModule>
Done









Thanks. It worked spot on!
thank you ! your answer is super direct and it just simply works ! thank you again
thanks for the comments
thank you!!! Putting this answer. it really helpful for me..
Thanks.
Thanks for comments
Rishikesh Vispute
Hi… this worked great for my magento site. [L] does this denote a permanent re-direct? Does it matter to SEO if I make it permanent redirect?
I also have the wordpress using the fishpig’s plug in. My link is broken for the blog. Do I need to re-write the wordpress htacc? if so, can you help please?
Thanks
This is what i was looking for, I have updated the Magento and face many problem, this caused my ranking down in Search Engine.
beautiful! works.
Thanks it works!
Hey,
Its Really Great. Thanks for sharing. Its very helpful for Magento Beginners.
Thanks.
thanks to all
Doesn’t work for me, except home is nothing working, all error 404.
What am I doing wrong?
Thanks
Please check your setting once again.
Thanks a ton my friend, it worked really well. Much appreciated.
Fixed it, went into phpmyadmin and went to core_config_data and took out the index.php at the end of the site..
My customer’s shop is set up as http://www.domain.com/magento
where the installation is in the magento folder in the www root (they’re running on IIS, not Apache).
The base url field is set to http://www.domain.com/magento
The following rewrite rules are being used (and work, though I believe I will need to add an exception for the search to work).
What changes do I need to make in the Magento installation, and the rewrite/redirect rules so that customers may use the site with the url form of http://www.domain.com/category_name instead of http://www.domain.com/magento/category_name?
Basically, I want to be able to remove the magento portion of the url, without re-installing and with the installation left in the magento folder.
############################################
## enable rewrites
#RewriteLog c:\inetpub\iirfLogs\iirf
#RewriteLogLevel 1
#RewriteLogLevel 3
Options +FollowSymLinks
RewriteEngine on
RewriteBase /magento/
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
############################################## never rewrite for existing files, directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
############################################## rewrite everything else to index.php
RewriteRule .* index.php [L,U]
Thanks a lot!
Worked like a charm
epic!
It was a bit scary to try, but I had no problems at all.
i installed a magento from web server to localhost
it shows me the home page but when i try to access the other links it gives page not found error!!!
and its working well on web server
and i also found that when i add “index.php” in the url manually it opens the link
does anyone know how to get rid of this????
thank u in advance
please check your .htaccess file and I am sure the the problem in .htaccess file
Hey, I red a post of you about magento and htaccess. (http://www.bestdesigns.co.in/blog/remove-index-php-url-magento)
I need to hide the /shop/ in url, but i can’t !
http://jem-editions.ch/ -> redirect to -> http://jem-editions.ch/shop/
I tried a lot of htaccess codes i found on the web, and your’s too, but no solution !! Do you have an idea ?
Hello,
Please refer the URL http://www.bestdesigns.co.in/blog/redirect-domain-to-subdirectory-without-redirect-url and add the correct rule in .htaccess file.
I’ve tried lots of others .htaccess but RISHIKESH VISPUTE is the BEST!.
Thanks,
D.
Thanks so much! I’ve search everywhere, and this worked perfectly. You Rock!!!
THANK YOU
THANK YOU
THANK YOU
THANK YOU
THANK YOU
THANK YOU
I’ve been trying to work this out for hours to no avail. This is the only rewrite rule that worked for me.
THANK YOU!
Thanks for comments
Rishikesh Vispute
Thanks for comments
Rishikesh Vispute
Hoststop.co.uk