.htaccess is a very useful topic for web developers. We use .htaccess for web sites SEO Friendly, for security and for various types of problem solving. Many of us do not understand htaccess. We use it without understanding and many others do not use it. After reading this article you have a clear view about this . htaccess file. For those who are freelancing, there will be a lot of help for them because marketplace htaccess relayed many jobs.
Some things about .htaccess
.htaccess is the configuration file used in the Apache web server. .htaccess is basically an unnamed file, .htaccess is an extension typing. It is hidden by default. This file is usually located in the server root directory, but it can be kept in another sub directory other than the root.
If you do not see .htaccess by default on your website CPanel, then you Show Hidden Files (dotfiles) when you open the file manager. Tick the check box. If you do not see it then create a file named .htaccess.
How to create a .htaccess file?
Very simple, you can create a .htaccess file directly on cpanel or you can upload it to your PC and then upload it.
Create Directly On Cpanel
Click on sepainle new file and type the name (.) After dot htaccess click on Create New File button. The .htaccess file was done.
Created on PC
Any type of code editor software such as Notepad ++ Sublime Text Brackets (.) Will be saved with the name dot htaccess, we can also do it with the ordinary notepad of the United States. Open the Notepad file while saving it. (.) With dot htaccess Save as type: To save all file. The .htaccess file went on.
How does .htaccess work?
Many ask questions about where to place .htaccess file or when to put it on the root; When to put a sub directory. Need to know how .htaccess works in order to know the correct solution for this question. Simply put, we compare the working style of .htaccess file to CSS. For example, if the font size of the body tag is 14 pixels, then all paragraphs, headings or more sub elements inside this body tag will have 14 font sizes of all. Again, if there is a font size of any directory within the tags, then the font size of all the elements within that device will be 16. The .htaccess file works exactly the same way: That means if you put the file on the root, the code in that .htaccess file will also affect the sub directory in the root. But if the .htaccess fight is placed in any sub directory / folder, then it will affect the file or subdirectory of that folder.