What is .htaccess?
.htaccess is a small settings file for the Apache web server. Apache is the program that sends your pages to visitors. WordPress uses this file to make pretty links, like yoursite.com/about. If the file is missing or broken, those links stop working. The file starts with a dot, so File Manager may hide it.
Warning: Back up your current .htaccess before you change it. Other plugins may have added rules that you will lose.
Method 1: Let WordPress make it
- Log in to cPanel and open File Manager.
- Click Settings at the top right. Tick Show Hidden Files (dotfiles). Save.
- Go to the folder where WordPress lives. This is often
public_html. - Right-click
.htaccessand choose Rename. Call it.htaccess-old. This is your backup. - Log in to your WordPress dashboard.
- Go to Settings then Permalinks.
- Do not change anything. Click Save Changes.
WordPress writes a new .htaccess file. Test your links.
Method 2: Make the file by hand
- In File Manager, click + File.
- Name it
.htaccessand click Create New File. - Right-click the file and choose Edit.
- Paste this default code.
This is the standard single-site WordPress rule set.# 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 - Click Save Changes.
- Open your site and test a few pages.
If your site is in a sub-folder
Change RewriteBase / to the folder name, for example RewriteBase /blog/. Also change the last rule to /blog/index.php.
If it still fails
- Check that the file permission is 644.
- Switch off your plugins one by one to find the cause.
- Check the error log in cPanel under Errors.
- Ask Hostvento support for help at https://secure.hostvento.com/submitticket.php.
Tip: Multisite WordPress uses different rules. Do not use this code for a multisite network.
Quick recap
- .htaccess controls pretty links in WordPress.
- Rename the old file, then re-save Permalinks to get a new one.
- Or paste the default code by hand.
- Always keep a backup of the old file.