What is .htaccess?
.htaccess is a config file for use on web servers running the Apache Web Server Programming. Whenever a .htaccess record is set in a directory/folder which is thusly ‘stacked through the Apache Web Server’, then the .htaccess document is recognized and executed by the Apache Web Server programming. These .htaccess documents can be utilized to adjust the arrangement of the Apache Web Server programming to empower/impair extra usefulness and elements that the Apache Web Server programming brings to the table. These facilities include basic redirect functionality, for instance, if a 404 file not found error occurs, or for more advanced functions such as content password protection or image hotlink prevention.
You might have a private area/pages of your website you wish to keep password protected. This password protection is actually set up in the .htaccess file. Most of the functions of the .htaccess file, you do not have to concern yourself with as they will be automatically written through cPanel. This is the case of password protecting directories. While you set it up in cPanel, it actually writes a directive to your .htaccess file.
Other functions of the .htaccess file include prohibiting hotlinks, rewriting URLs, setting default pages, creating redirects, reconfiguring account settings, and much more. It’s really important to realize how the .htaccess file can affect your entire account. Changing something in the .htaccess file can alter how your website functions so it’s really important BEFORE making changes to your .htaccess to backup your current .htaccess file.