Magento 1.7 - remove index.php from url

11,160

I found this solution somewhere which works for me:

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

this returns:

http://mydomain.com/ so index.php is removed from the url.

And in a template I now use this:

{{config path="web/unsecure/base_url"}}doc/toc.pdf

which also returns the url without index.php

Share:
11,160

Related videos on Youtube

A.W.
Author by

A.W.

Software developer. Electronics hobbyist.

Updated on August 03, 2022

Comments

  • A.W.
    A.W. over 1 year

    I have the following settings:

    Use Web Server Rewrites => Yes

    In htaccess I have RewriteBase /

    Caching is disabled.

    In one of my email templates I use <a href='{{store url="doc/toc.pdf"}}'>xxxx</a>

    This results in /index.php/doc/toc.pdf/

    How do I remove the /index.php part?

    The links in the rest of the store do not show index.php in the url.

    I also have this when using Mage:getUrl in a .phtml file

  • Pradeep Singh
    Pradeep Singh over 5 years
    Is it recommended way?