.htaccess is a system file with certain Apache web server configuration instructions. It provides ability to manage such configuration on the level of specific directory. There is a necessity of .htaccess usage when you don’t have access to the main server configuration file.
.htaccess file on an Apache web server lets you activate or deactivate things like your 404 page, set passwords or prevent others from linking to videos and pictures from 3rd party websites.