I'd be interested to learn more on writing a custom RootMappingServlet. Can you send me a brief example?
I did try to write a custom LogoutServlet, define a custom url instead of using "/system/sling/logout", and used Authenticator.logout(request, response). This method works but the problem is that the Response gets invalidated and we cannot use a custom Redirect url. Whatever is defined in the RootMappingServlet is picked to show. This works good if you have one site. But for multi-site this was not the case.
One solution that worked for me:
We can add "resource" param to "/system/sling/logout" defining the path that should load after logout. No need to write any additional code.
<a href="https://forums.adobe.com/system/sling/logout?resource=/content/yoursite/en.html">Logout</a>
If you have multiple sites, then.. your Root Mapping Servlet can be the default value (for us it was : /projects.html)
<a href="https://forums.adobe.com/system/sling/logout?resource=/content/yoursite1/en.html">Logout</a> <a href="https://forums.adobe.com/system/sling/logout?resource=/content/yoursite2/en.html">Logout</a>