By editor, 20 February, 2017 Question How to override 401, 403 and 404 error pages on Drupal 8 ? You have several mthodes to override 403 / 404 System pages. Method 1. Set 403 / 404 pages. You can set the 403 /404 page on "Basic site settings" page Admin -> Configuration -> System -> Basic site settings Path /admin/config/system/site-information Method 2. Override system 40x Pages (/system/404 ...) Step 1. Create a custom module (Here : 'mymodule'). Step 2. Create a basic page (Here : \Drupal\mymodule\Controller\MyErrorPage:on404). Step 3. Add routing.yml file (Here : mymodule.routing.yml). Example: mymodule.system.404: path: '/system/404' defaults: _controller: '\Drupal\mymodule\Controller\MyErrorPage:on404' _title: 'Page not found - 404' requirements: _access: 'TRUE' Tags Drupal 8 Code Add new comment Create a simple module for Drupal 8 - Step 2 - Create Simple Page Comments1 You must have JavaScript enabled to use this form. Your name Subject Comment About text formats Plain text No HTML tags allowed. Lines and paragraphs break automatically. Web page addresses and email addresses turn into links automatically. That doesnt work Error says the path already exists Reply
Comments1
That doesnt work
Error says the path already exists