我目前正在 Drupal 9 上创建自定义错误页面。
我知道我可以轻松地为 404 和 403 添加自定义页面,但是如何使用自定义页面来处理所有可能的错误,例如 401、403、500、502 等?
我找到了这个模块:https://www.drupal.org/project/error_page但我看不到结果,不太确定我搞砸了哪一部分。
如果使用 NGINX,请包括以下内容:
server {
error_page 500 501 502 503 504 505 506 507 508 510 511
@error_5xx;
location @error_5xx {
rewrite ^/(.*)$ https://$server_name/error_5xx.html;
}
}
在配置文件的服务器部分。