.htaccess (stand for Hypertext Access) is a great role player in the process of optimizing and tweaking websites conditionally.! Let’s dig the .htaccess file and its power.

Most important step: Download your .htaccess file and make a copy.

.htaccess resides in your website root directory. ie; www.example.com/.htaccess. Any rules written in .htaccess file will be applied to its directory and sub-directories as well. Basically .htaccess file is set of command which can control, configure Apache Web Server and also interact with the server. 

If you are unable to find it in your Cpanel, nothing to worry, you can create it by your own. Just open any text editor (CodeRomeos prefer Notepad ++) , save it as  .htaccess  (No extensions).
Done! Quite Easy. Isn’t it.?

Let’s move ahead.!

We will learn the following .htaccess rules step by step.

Error Redirects 404
Allow/Deny visitors by IP address
GZIP Compression
Setting Expiry 
Deny visitors by referrer
DirectoryIndex uses
Adding MIME types
Disable directory listings
Setting server timezone
Preventing access to your PHP includes files
Prevent access to php.ini

If you have any issue, let us know in the comment box.