"Page not found" when accessing a custom module I have created the custom registration module for drupal8. I define the path on routing.yml file but when access that module on browser side I got "Page not Found" message.  Here the sample code.

custom_form.routing.yml

    custom_form.register:
path: '/custom_form/my_form'
defaults:
 _form: '\Drupal\custom_form\Form\Formsettings'
 _title: 'Registration page'
 requirements:
  _permission: 'view user registration form'


custom_form.module

error_reporting(E_ALL);
ini_set("display_errors", 1);
/**
*@file
*custom_form.module
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implementation of hook_permission()
*/

function custom_form_permission() {
  return array(
    'submit custom_form' =&gt; array(
      'title' =&gt; t('Submit custom_form'),
      'description' =&gt; t('Submit the custom_form Form'),
    ),
  );
}

/**
* Implementation of hook_menu()
*/
function custom_form_menu() {
$items=array();
    $items['custom_form/my_form'] = array(
     'title'=&gt; 'My Example Form',
     'route_name' =&gt; 'custom_form.register',
     );
    return $items;
  }
As stated, YAML has very specific spacing rules.

custom_form.register:
  path: '/custom_form/my_form'
  defaults:
    _form: '\Drupal\custom_form\Form\Formsettings'
    _title: 'Registration page'
  requirements:
    _permission: 'view user registration form'


Try that spacing, and Formsettings will need to be a form controller in custom_form/src/Form if it isn't already - you didn't link to it.

Both hook_permission() and hook_menu() are no longer used, so you'll want to remove them from the code base. (though I don't think they will stop it from loading properly.)