.htaccess is a hidden text file that contains additional configuration for websites hosted on Apache (and LiteSpeed) server. With .htaccess file you can create redirects, password-protect directories, block IPs and much more. For some examples on .htaccess files make sure to check this .htaccess Cheatsheet.
How to find the .htaccess file
On cPanel after you login to the File Manager click on the Settings button in top-right corner, then select “Show Hidden Files (dotfiles)”, save and navigate to your website root directory.
How to create an .htaccees file
If there is no .htaccess file present you can create one as any other file in File Manager:
Here is an example: Default .htaccess file for WordPress:
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Was this post helpful?
Let me know if you liked the post. That’s the only way I can improve. 🙂