类别网址在magento中转到404页面

Dha*_*pal 1 magento

当我在侧边栏中列出类别时,我是magento的新手.当我点击类别名称意味着它将转到404错误页面.如果您有任何想法请尽快告诉我..

我的代码是

<?php
$_categories = Mage::getModel('catalog/category')->load(3)->getChildrenCategories();
if($_categories->count()):
   $categorycount = 0;
   foreach ($_categories as $_category):
         if($_category->getIsActive()):
         $cur_category=Mage::getModel('catalog/category')->load($_category->getId());
         $layer = Mage::getSingleton('catalog/layer');
         $layer->setCurrentCategory($cur_category);


   ?>
       <li><a href="<?php echo $_category->getURL() ?>" title="<?php echo             

        $this->htmlEscape($_category->getName()) ?>"><span class="categoriesHead"><?php   
        echo $this->htmlEscape($_category->getName()) ?></span>
        </a>

        </li>
       <?php
      endif;

    endforeach;
endif;

?>
Run Code Online (Sandbox Code Playgroud)

Dav*_*ave 6

我在1.5.1中遇到了同样的问题,在我的情况下,它是类别url后缀,它期望一个.html后缀,但链接给了我空白.我Admin>>System>>Configuration>>Catalog>>Search Engine Optimisations>>category suffix从".html"改为""(空白),现在工作正常.