Change logout redirect link in admin menu

Silverstripe Version:4*

I hope I’m not spamming too much with basic questions :slight_smile:
I’m trying to change the redirect link after logout from admin area.
The logout button under sitename.
I tried accessing with this example but I mainly get the error: LeftAndMain subclasses (CustomAdmin) must have url_segment.
Basically I wish to redirect to home page and not to login form after logout.

use SilverStripe\Admin\ModelAdmin;

class CustomAdmin extends ModelAdmin
{
     private static $menu_title = 'My Custom Admin';
}

I solved this with a custom logout controller. But I would like to learn how to handle the admin cms.

routes.yml

---
Name: approutes
After: framework/_config/routes#coreroutes
---
SilverStripe\Control\Director:
  rules:
    'Security/logout' : 'LogoutController'

LogoutController.php

use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Security\IdentityStore;

class LogoutController extends Controller
{
    public function index(HTTPRequest $request)
    {
        Injector::inst()->get(IdentityStore::class)->logOut($request);
        $this->redirect(Director::BaseURL());
    }
}

I found out that this solution works only on a local machine (WAMP). Does anybody know what would be the correct rule to catch this and route to my custom controller?

This works only on a local WAMP

---
Name: approutes
After: framework/_config/routes#coreroutes
---
SilverStripe\Control\Director:
  rules:
    'Security/logout' : 'LogoutController'