How to Configure your .htaccess file for WordPress
The .htaccess file is an important WordPress file used for permalinks, redirects and other Apache server rules.
This guide explains how to find, create and update your WordPress .htaccess file inside cPanel.
.htaccess file is usually a hidden file. In cPanel File Manager, you may need to enableShow Hidden Files (dotfiles) before it appears.
Default WordPress .htaccess Code
The essential .htaccess code normally used by WordPress is shown below:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPressLocating Your .htaccess File in WordPress
Firstly, log in to your cPanel account either through the client area or by using your cPanel login details.
- Log in to cPanel.
- Go to Files.
- Select File Manager.

Then double click the public_html directory.
The default setting within cPanel is that dot files are hidden. Therefore, if you do not see the
.htaccess file, you will need to check that hidden files are enabled.
- Click Settings in the top right-hand corner.

This opens the Preferences dialogue box. Select the checkbox for
Show Hidden Files (dotfiles), then click Save.
The page will reload and should now display your .htaccess file.
Create a New .htaccess File in cPanel
If you have migrated your website from another host to Cheap Host and your .htaccess file is missing,
you may need to create a new one so that your WordPress permalinks work correctly.
- Open cPanel File Manager.
- Go to your public_html directory.
- Select + File in the top left of the screen.

- Type .htaccess as the file name.
- Click Create New File.
The page will then reload and you should see that the .htaccess file has been created.
It will usually appear directly underneath the wp-includes folder.

Editing the .htaccess File
To add the required WordPress .htaccess code, highlight the .htaccess file using the left mouse button,
then click Edit from the top menu options.
Click Edit again when the dialogue box appears, then copy and paste the following code:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPressNow click Save Changes at the top right-hand corner of the page. That is all done.
404 Error in WordPress After Site Migration
One of the most common causes of a 404 error after moving your website to Cheap Host is that the
.htaccess file is missing from your WordPress installation.
This is because the .htaccess file controls the permalink structure within your website.
Your homepage may load correctly, but other pages may show a 404 error.
.htaccess file using the WordPress code above.Still Having Problems?
If you are still having problems with your WordPress .htaccess file, please sign in to your hosting account and open a support ticket.
Our team will be happy to help.