Create custom module but page not found I'm new on Drupal. I try to follow a tuto in order to build my own module.

Drupal 8 (latest version) is installed on MacOS.
For example, I use it through URL : http://localhost/drupal/admin/content

My module is defined like this :


Drupal


code
modules        


hello_world


hello_world.info.yml
hello_world.links.menu.yml
hello_world.routing.yml          


src


Controller


HelloController.php





...



File content : hello_world.info.yml

name: Hello World Module
description: Creates a page showing "Hello World".
package: Custom
type: module
version: 1.0
core: 8.x


File content : hello_world.routing.yml

hello_world.hello_world:
  path: '/hello'
  defaults:
    _controller: '\Drupal\hello_world\Controller\HelloController::helloWorld'
    _title: 'Hello World'
  requirements:
    _permission: 'access content'


File content : hello_world.links.menu.yml

hello_world.admin:
  title: 'Hello module settings'
  description: 'example of how to make an admin settings page link'
  parent: system.admin_config_development
  route_name: hello_world.hello_world
  weight: 100


File content : HelloController.php

&lt;?php
/**
 * @file
 * Contains \Drupal\hello_world\Controller\HelloController.
 */

namespace Drupal\hello_world\Controller;
use Drupal\Core\Controller\ControllerBase;

/**
 * Defines HelloController class.
 */
class HelloController extends ControllerBase {

  /**
   * Display the markup.
   *
   * @return array
   *   Return markup array.
   */
  public function helloWorld() {
  $output = array();

  $output['hello_world'] = array(
    '#markup' =&gt; $this-&gt;t('Hello World!'),
  );
  return $output;

  }

}


Regardless "clear cache", I have a page not found !

I try the urls : 


http://localhost/drupal/hello
http://localhost/hello


But results are the same. What should be the right url ?
And why I'm getting "page not found", where is the issue ?
Creating a module does not automatically enable it.

I tried your code in a clean Drupal 8 installation and /hello show the page as expected.

Try running drush en hello_world to enable you module and you should be ok.

If that is not the case, then you can use drupal route:debug to see a complete list of your site routes, so you can know if your route is registered.