1

I was attempting to customize Magento's 503 and Maintenance error pages (404 is set up and works fine), but Magento can't load the stylesheets for the error pages.

If I put Magento in maintenance mode, or force some kind of DB error, it does load the appropriate page, but when it attempts to load css/styles.css that page, too, returns the error page instead if the css file.

How can I fix this?

Edit:

My folder structure, as requested

errors/
errors/404.php
errors/503.php
errors/design.xml
errors/local.xml
errors/processor.php
errors/report.php
errors/default/
errors/default/404.phtml
errors/default/503.phtml
errors/default/page.phtml
errors/default/report.phtml
errors/default/css/styles.css
errors/default/images/

I use maintenance.flag to force Magento to give me an error page. It tries to load http://localhost/css/styles.css but that returns a 503, so I get an unstyled error page.

If I access http://localhost/errors/default/css/styles.css I get the Magento error page, but it is styled (its able to load stylesheets). Loading any random url starting with the path http://localhost/errors/default/ loads the error page correctly, so it seems to have something to do with how magento is building the error pages...

1 Answer 1

3

First of all make sure that you customized error pages in proper way.

Follow simple steps:

  1. Go to /errors and create new folder for example custom.
  2. Copy /errors/default content into /errors/custom.
  3. Edit /errors/design.xml and set custom skin

    <config>
        <skin>default</skin>
    </config>
    

Now customize html files in /errors/custom end styles in /errors/custom/styles.css.

If you want to access your styles through browser http://localhost/errors/custom/styles.css

Also I recommend you to read this article.

10
  • even the default error pages do not render correctly
    – andyjv
    Commented Feb 21, 2014 at 0:45
  • What is the problem with default pages? Commented Feb 21, 2014 at 7:06
  • Same problem- it can't load any external files. So references to the CSS and just return the error page.
    – andyjv
    Commented Feb 21, 2014 at 12:54
  • Could you send me the url which you use to access css file? Commented Feb 21, 2014 at 13:40
  • I updated the answer. Commented Feb 21, 2014 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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