Those running a public web server are frequently subject to bot scans. While using best practices is the proper approach, there may still be a lot of 404 log results from bots. Declutter the log by redirecting bot URLs to a single zero-byte empty page while still returning code 404.
Since these files are legitimate, but may not be used by your site, we create empty files for these:
favicon.ico ads.txt app-ads.txt
Netlify _redirects file
should usually NOT be at the root of the source repo, but should instead be in the site
For Hugo it may be
We prefer the
_redirects file to netlify.toml, because the redirect syntax is much more concise in
_redirects file as below.
to instantly test file syntax.
Here is our _redirects file for a Hugo blog, which may need editing to be suitable for your site.