Magento – Magento 2 Custom error Landing pages (500, 401 and etc)

custompagemagento-2.1.3magento2

I have a question on how to display those error pages except for 404 error page. because it can be created using cms page. I wonder why on how to create error pages like 500 and etc. I hope someone can help me. Correct me if I'm wrong.

Thanks

Best Answer

First, create a 500.html page in your document root (usually a public_html/ or www/ directory).This should probably be a static HTML page rather than anything dynamic (i.e. PHP). Then Add the following rule to the start of your Magento .htaccess

## rewrite errors to 500 error document
RewriteRule ^report/.* 500.html [L,R=503]

This will then redirect any requests for an error report page using a 500 response code (Internal server error) and display the 500.html page in place of the standard Magento page.

Related Topic