I have a live running e-commerce platform, when there is any kind of error, it displays error number with text saying "There has been an error processing your request".

How to avoid this page and show a normal page with default Magento header and footer and a custom content saying something like "Something went wrong, please try again"


You can accomplish this with the .htaccess ErrorDocument directive. If you search for "ErrorDocument", you should find the following couple of lines in your .htaccess file:

# For 404s and 403s that aren't handled by the application, show plain 404 response
ErrorDocument 404 /pub/errors/404.php
ErrorDocument 403 /pub/errors/404.php

You can simply append a few lines for the 500-505 errors that you are experiencing:

# for Internal Server Error
ErrorDocument 500 /pub/errors/404.php 
# for Service Unavailable
ErrorDocument 503 /pub/errors/404.php
# for Gateway Timeout
ErrorDocument 504 /pub/errors/404.php

Note: The three errors that I included are for specific errors and should include yours, but if that is not the case, the link at the top of this post has a full breakdown of the potential HTTP response codes that you could add.

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.