2

I have created a cms page for categories which list all the subcategories of that current category. My issue is i am getting index.php appended when i click on subcategory links from that cms page. Other than that i have removed index.php from entire website. SEO friendly urls are enabled.

 my 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]
RewriteRule . /index.php [L]
</IfModule>

When i click on category from navigation menu , the url I am getting is -

 magento.com/category1.html

But , from cms page , the Url I am getting is -

magento.com/index.php/catgeory1/subcategory.html

Why index.php is getting appended when i click on category link from cms page?

What am i doing wrong ?

 $_helper = Mage::helper('catalog/category');
 $category = Mage::getSingleton('catalog/layer')->getCurrentCategory();

 $categories = $category->getCollection()
            ->addAttributeToSelect('*')
            ->addAttributeToFilter('is_active', 1)
            ->addIdFilter($category->getChildren())
            ->addUrlRewriteToResult();

 //To get category url -
         echo $_helper->getCategoryUrl($category);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.