Magento 1.7 - remove index.php from url

I have the following settings:

Use Web Server Rewrites => Yes

In htaccess I have a RewriteBase /

Caching is disabled.

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

The result is /index.php/doc/toc.pdf/

How to remove the /index.php part?

Links in the rest of the repository do not display index.php in the url.

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

+4
source share
2 answers

I found this solution somewhere that 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 the template, I now use this:

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

which also returns url without index.php

+13
source

Try adding this to your .htaccess file.

 RewriteRule .* /index.php [L] 

Remember to clear the cache.

0
source

All Articles