Twig template suggestions for paths such as page--node--page-url using D8, I'd like a twig template for a page I've created based off the path of the page and not node %. I look in my twig suggestions and all I see are:

page--node--8.html.twig
page--node--%.html.twig
page--node.html.twig
page.html.twig


As template suggestions. However, as I'm working in multiple environments and don't know what the node number will be when I actually create this page I'd like to just base it off the path I've set for the page which is '404-error'. Anyone know how to do that?

I'm imagining something like page--node--404-error.html.twig

However that doesn't seem to work (I tried it).
You can add suggestions for the page template in a hook:

mytheme.theme:

/**
 * Implements hook_theme_suggestions_HOOK_alter().
 */
function mytheme_theme_suggestions_page_alter(&amp;$suggestions, $variables) {
  $path = \Drupal::requestStack()-&gt;getCurrentRequest()-&gt;getPathInfo();
  if ($path != '/') {
    $path = trim($path, '/');
    $arg = str_replace(["/", '-'], ['_', '_'], $path);
    $suggestions[] = 'page__' . $arg;
  }
}


This is an example how to add a suggestion with the path for any page. You can narrow it down to the pages you are interested in and if necessary check for paths that are too long.