Force non .html to .html

Hello, I’m trying to point all requests that are not ending in .html to .html (obviously without affecting sitemap that ends in .xml).
Right now any address that ends without the html are pointing to 404 error.
Friendly url is active and everything is working fine just have that little problem.

Can anybody guide me?

you could try to use a plugin, which fires at OnPageNotFound with sendForward or sendRedirect, something like that:

if ($modx->context->get('key') != "mgr") {

    //echo $_REQUEST['q'];die();

    if ($id = $modx->findResource($_REQUEST['q'] . '.html')) {
        $url = $modx->makeUrl($id);


Thank Bruno, it’s working fine!