How to Create a .htaccess File
There are a few instances where your WordPress installation will not include the .htaccess file by default. Alternatively, a broken plugin might corrupt this server configuration file and disrupt your site. In these cases, you will need to create a new file from your hosting control panel manually.
 Choose the New File button on the upper-left corner of your screen.
 New File option on cPanel.
Enter .htaccess as the file name, then insert the code below:
 # BEGIN WordPress <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteRule ^index.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 </IfModule>
 # END WordPress  Once you’ve added the code, press Create to save your changes. Keep in mind that the code is universal for all WordPress sites. However, other content management systems (CMSs) will have different code for their .htaccess files.
Aside from the method above, you can also use a text editor such as Notepad to create a .htaccess file, then upload it to your web server using an FTP client.

