Redirect all 404 to 301 (.htaccess)

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…

Force https and activate mod_deflate

This is my .htaccess file that manages the https and gzip compression(server side).