How to find and create the .htaccess File

The .htaccess is a hidden text file that contains some additional configuration for the websites hosted on an apache server, and it can directly affect how your website behaves in certain situations.

By using .htaccess, you can rewrite the URL, Redirect your website. Password-protect your directories and disable access from a specific IP address.

How to find the .htaccess File:

  • Login to your Cpanel.
  • Under the files section, click on File Manager, then public_html folder.
  • By default, .htaccess is invisible on Cpanel servers.
  • To find the File click the settings on the upper right menu and tick Show Hidden Files (dotfiles)

How to create the .htacees file:

If you cannot find your .htaccess File by following the previous step, you can create a new one.

  • Go to your Cpanel’s File Manager.
  • Click the New File button on the upper menu.
  • Enter new file name as .htaccess.
  • Insert below default code to create a new .htaccess file.
# 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>