A [.htaccess] file is a configuration file that tells your server how to handle certain things on your website. Like how to deliver web pages, redirect users, password-protect the admin area, protect some directories, etc.
Make the File Visible
The [.htaccess] file remains hidden by default. Follow these instructions to make it visible:
- Go to cPanel > File Manager.
- Click "Settings" from the top right corner.
- Check mark [*] "Show Hidden Files (dotfiles)"
- Click "Save".
- Done.
The [.htaccess] file is usually located inside the [public_html] directory of your primary domain. If you have any additional domains, you will find them inside their respective directories.
Regenerate or Refresh the File
Make sure to take a backup of the original [.htaccess] and [.user.ini] files before regenerating them.
Get Current Permalink Setting:
- Go to WP Admin > Permalinks.
- Note the currently selected option.
- Done!
Rename the Files:
- Go to cPanel > File Manager.
- Rename the [.htaccess] file to [bk-htaccess].
Select the file and click "Rename" to rename it.
Do not delete the file in case you need it later. - Rename the [.use.ini] file to [bk-user.ini].
*Your website might not have the file. - Done.
Regenerate the File:
- Go to WP Admin > Permalinks.
- Select a different permalink option.
- Click "Save".
- Select the original permalink option.
- Click "Save".
- Done.