0

   I want to redirect all 404 errors to Home page in my website. But currently what is happening is that, After following the basic procedure of selecting the Home Page in :

  • System -> Configuration -> General -> Web -> Default Pages -> CMS No-Route Page.
  •    It does redirect to my home page, but the Banner Slider does not work and just load all the slider images one below another. The home page works perfect when accessed directly by the base url.

    1

    Most probably a js file is not loaded when viewing the homepage as the 404 page.
    if the js file is added from the layout file like this:

    <cms_index_index>
        <reference name="head">
           <action method="addJs">....</action>
        </reference>
    </cms_index_index>
    

    You should add the same xml for the layout handle <cms_index_noroute>.
    If the file is added in a template file using:

    <?php if ($this->getIsHomePage()) :?> 
        <script...></script>
    <?php endif;?>
    

    you might want to change the logic of that. There is a bug/feature in getIsHomePage that makes it return true oly if the url matches the homepage.

    • Hi Marius, thanks alot for help. But I am N00b, would you be able to point to the location of the files. And a pointer on what should be the possible condition. Would you say to just remove $this->getIsHomePage() and just put a true. That would always evaluate to true. Or would you suggest some thing else Appreciate you help. – Maharshi Raval Feb 21 '14 at 8:59
    • @MaharshiRaval I think in your case it's better just to remove the condition, and let the js load every time is called. I don't think that an extra js file will have a huge impact on performance – Marius Feb 21 '14 at 9:02
    • Thanks , will try it later tonight when the traffic is minimum. You saved a lot of my time. – Maharshi Raval Feb 21 '14 at 9:27

    Your Answer

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

    Not the answer you're looking for? Browse other questions tagged or ask your own question.