How to create custom 401, 403 and 500 error pages?
EError pages are served up via .HTACCESS, if you are using Apache you would use the ErrorDocument directive and add the status and URL to it. So it would look like this in your .htaccess file:
1 2 3 |
ErrorDocument 401 http://yourwebsite.com/error-401 ErrorDocument 403 http://yourwebsite.com/error-403 ErrorDocument 500 http://yourwebsite.com/error-500 |
You could use the following function below. This will dynamically add what is needed to the HTACCESS […]