How to route to a controller action in Craft3? Before I get tagged as a duplicate I have already tried everything in the 'duplicate' issues on here to no avail so I'm posting my exact config to see what I'm doing wrong.

Here is my plugin code and my controller code

// My plugin and init funciton
use belniakmedia\sitedominjector\controllers\DefaultController;
class SiteDomInjector extends Plugin
{
    /**
     * @var SiteDomInjector
     */
    public static $plugin;

    /** @var array */
    public $controllerMap = [
        'default' =&gt; DefaultController::class,
    ];
    public function init()
    {
        parent::init();
        self::$plugin = $this;

        // Register our site routes
        Event::on(
            UrlManager::class,
            UrlManager::EVENT_REGISTER_SITE_URL_RULES,
            function (RegisterUrlRulesEvent $event) {
                $event-&gt;rules['echo'] = 'site-dom-injector/default/index';
            }
        );
    }
}

// My Controller
class DefaultController extends Controller
{
    protected $allowAnonymous = true;

    public function actionIndex()
    {
        $result = 'Welcome to the DefaultController actionIndex() method';
        return $result;
    }
}


I really don't know if that controller map is necessary or not but one of the posts on here said they got it to work setting that up, so thats what I did.

Here is a photo of my plugin's file structure for continuity:


I really have no idea why this isnt working but no matter what I do, when I try to browse to http://site.local/echo I get a 404 not found and the trace seems like its not even attempting to load the controller and is just looking for a matching template file... :(

Any ideas?
The problem ended up being something underlying in craft or yii2 that will not route the word "echo".

I changed out "echo" to "test" and it works fine. Even with both routes in, one does not and one does:

    // Register our site routes
    Event::on(
        UrlManager::class,
        UrlManager::EVENT_REGISTER_SITE_URL_RULES,
        function (RegisterUrlRulesEvent $event) {
            $event-&gt;rules['echo'] = 'site-dom-injector/default/index';
            $event-&gt;rules['test'] = 'site-dom-injector/default/index';
        }
    );