When updating the .htaccess file or accidentally deleted that important file, you loose your site. Or your have no idea what to do. Well, don’t be afraid just yet. Keep scrolling and learn what is .htaccess file and how to create it. so you can configure some additional settings for your site.
What Is .htaccess File?
The .htaccess file is an essential WordPress core file to reconfigure specific settings of the Apache Web Server. This file helps you enable or disable certain features of your server, like creating a redirection from non-www to www URLs or resetting permalinks structure.
Additionally, the .htaccess file can handle your WordPress security settings. You can use it to set up privileges for particular files, configure password protection, and block spambots.
Once you’ve installed WordPress on the Apache webserver, you can find the .htaccess file in your root directory. However, this file is usually hidden, so you need to enable the Show Hidden Files option to access it.
But in some rare instances, your WordPress installation may not contain the .htaccess file. Thankfully, you can manually create the default .htaccess file using your hosting control panel.
How to create .htaccess file in cPanel account.
Step 1: Login to cPanel account
Step 2: Open file manager
Step 3: Turn on “show hidden files option” in setting to view hidden files. Setting is given at the top of the page.
Step 4: Enter the file name and location for creating a new file. Then click the button “Create New File”.
Step 5: The .htaccess file can be viewed in the list of files in File Manager.
I hope this method will solve your problem. If yes, than give a share.