We have a custom 404 page set up in our EE 4.3.8 to handle non-existing url requests. I can't get it to work though, the home page always comes up instead. I know this may have something to do with how our .htaccess rules are set up but I can't figure out what is breaking this. We have ErrorDocument 404 /site/404
in our htaccess file pointing to the correct template but the 404 page never gets displayed, we also have the static page caching rules from the stash documentation and I'm wondering if they are redirecting our bad urls to our homepage? Here is some relevant code below, the 404 rewriteRule is commented out but ucommenting it and the lines before it still redirect bad urls to our homepage.
## Redirect to Cache File
RewriteRule ^(index.php/*)*(.*)(/*) /ourStaticCacheDirectory/1/$2/index.html [L]
# Prevent direct access to static cache folder
# RewriteCond %{REQUEST_URI} /ourStaticCacheDirectory/
# RewriteCond %{ENV:REDIRECT_STATUS} ^$
# RewriteRule .* /404 [L]
Thanks in advance for any help.