How to change page not found page error message in drupal 8? In my drupal 8 site I want to change my page not found page error message. Recently message showing like this "The requested page could not be found.". But I want show message like this "The requested page "/nvzmx,nvm,zxnv," could not be found.".

Note: my question is not about how to create a custom page for "page not found", instead I only want to change this actual error message.
You can do this by overwriting the route system.404 with a custom controller:

mymodule/src/Controller/MyHttp4xxController.php

&lt;?php

namespace Drupal\mymodule\Controller;

use Drupal\Core\Controller\ControllerBase;

class MyHttp4xxController extends ControllerBase {

  public function on404() {
    return [
      '#markup' =&gt; $this-&gt;t('Custom 404 message'),
    ];
  }


mymodule.routing.yml

system.404:
  path: '/system/404'
  defaults:
    _controller: '\Drupal\mymodule\Controller\MyHttp4xxController:on404'
    _title: 'Page not found'
  requirements:
    _access: 'TRUE'


mymodule.install

&lt;?php

function mymodule_install() {
  module_set_weight('mymodule', 1);
}


You have to be sure, that your module runs after the system module, so that you can overwrite the route from the system module. This is why you need to set the module weight to 1. You need to reinstall the module, when you implement this.