Something Different In Linux

Home » CMS » magento » remove index.php from url in magento

remove index.php from url in magento

Posted by Rishikesh Vispute Categories: magento

How to remove index.php from url in magento

Ans :

If you want to access your magento URL without index.php

for example:


then use the following steps

1) Login to admin section by using the URL

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]

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]


39 Responses so far.

  1. antonio says:

    its not working for me. I have done from the admin side and also added htaccess. It redirects me to the wamp server page.Any idea

    • If you apply this solution then your index page should be a index.php
      If it redirect the wamp then you need to change the path in code.
      Please check your document root path of your magneto installation and set that folder name in .htacces file

      If the magento installed under /shop or directory then add the following rules into ” /home/username/public_html/shop/.htaccess ” file.

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

  2. This article presents clear idea for the new
    users of blogging, that genuinely how to do blogging.

  3. Everything is very open with a precise description of the challenges.

    It was really informative. Your website is very helpful.

    Many thanks for sharing!

  4. Thanks for every other excellent post. Where else may anyone get that type of information in such an ideal manner of writing?

    I’ve a presentation next week, and I am on the search for such info.

  5. Pretty great post. I simply stumbled upon your weblog and wished to
    mention that I have truly enjoyed browsing your blog posts.
    In any case I’ll be subscribing for your feed
    and I’m hoping you write once more very soon!

  6. Mk says:

    You can remove index.php from your magento site by following this tutorial :

    Thank You

  7. WOW just what I was looking for. Came here by searching for remove index.php from url in magento

  8. I think everything posted was actually very reasonable.
    But, what about this? what if you were to create a awesome post title?
    I ain’t suggesting your information is not solid, however what if you added something that grabbed a person’s attention? I mean How to remove
    index.php from url in magento is a little boring. You could glance at Yahoo’s front page and see how they create post headlines to grab viewers to open the
    links. You might add a related video or a picture or
    two to grab readers excited about everything’ve written.
    Just my opinion, it might make your blog a little bit more interesting.

  9. Mohamad says:

    thanks a ton worked for me

  10. Farukhkhan says:

    Thank you so much 🙂 Its 100% works!

  11. Davey says:

    thank you verry much!

  12. Keerti says:

    Thanks ! For this easy and simple way …

  13. Chanel J. says:

    This worked perfectly! Thank you so much!!

  14. It worked for me! fair and simple. Thank you.

  15. masoud says:

    Thanks you very much …

  16. vaibhav says:

    I was follow you step but i am getting the 500 internal server error Please check
    Please check this and answer me ASAP my client is waiting for updates

    Thanks in advance

  17. james says:

    Thank you for this post, worked perfectly.

  18. Marty says:

    Thanks so much for this – it’s something that, as an SEO, has bugged me for some time – now my URLs look sexy again!

  19. Brendan says:

    Thanks for posting this Rishikesh we moved our magento site from one server to another and none of the links would work.

    I was tearing my hair out for two days trying to fix it before I found this post.

    This fixed it for me.

    Thank you!!

  20. Thanks you for the post Bro…..

  21. Musaver says:

    I have done all the steps and it works, index.php removed, But now when I open category then it shows 500 internal error, and if I manually add index.php in URL then it will work.

  22. pankaj says:

    Thanks worked perfectly…i tried lots of other things but nothing worked for my extra installation of magento in sub-directory ..thanks a lot..cheers

  23. Topic says:

    Thank you kind person for putting the best solution up~! I found my root .htaccess was empty, with all the information in the .htaccess.sample – that was where I spent most of my time making the adjustments which had no effect. Finally I pasted your code into the empty .htaccess file, and voila, it works!

  24. amoii says:

    i’m using magento,it took me nearly a half day to dig on the internet to find a perfect solution,until i found your post.when i was trying to follow your steps i suddenly worked it out.

    My problem is that i unzipped the and moved all the files into the website root. however the hidden .htaccess and .htacess-sample were not moved to the website root,still stayed in the folder”magento”.so i changed the setting of my CuteFtp to show hidden files,and moved these 2 files into the root.

    All i did is only the setp 2 you mentioned above,all worked well,don’t need to touch /change any codes in the .htaccess or any other configuration in the magento admin panel.

    hope this helps to someone which the problem is the same.

  25. Rajnish says:

    sorry its not working by mistake i typed now* 😛

  26. Rajnish says:

    now working i tried all the things 🙁

  27. Gerry says:

    Thank you so much, worked like a charm!

  28. Niyi says:

    Thanks. It worked spot on!

Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...