.htaccess (short for ‘hypertext access’) is a configuration file for use on web servers running the Apache Web Server software.
The .htaccess file is common to place in a site’s root directory e.g. /public_html but you can put in another directory.
Because the .htaccess file is a server configuration file a typo can cause your server not working!
You can do redirecting URLs with an .htaccess file or block Ips from access your server.
Make sure to backup your file before edit it.