This is the simple code that I use to redirect all 404 errors (Not Found) to 301 (Moved Permanently). This will help you a lot if you had a previously WordPress site or another popular CMS that used a lot of permalinks to display content (eg.: tags, categories etc.).
This will also help with Google Search Console not found errors. After a new Google Crawl Index it will show a clean domain with no 404’s.
Hope it helps…
RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . / [L,R=301]