How to Fix WordPress Permalinks and 404 Errors
If your home page works but posts or pages show "Page not found", go to Settings → Permalinks and click Save Changes to rebuild WordPress's rules. If WordPress then says to update .htaccess, fix that file's permissions or paste the rules in yourself.
Applies to: cPanel WordPress Blue Arctic Shared Web Hosting (cPanel); WordPress 7.x
On this page
Permalinks are the permanent addresses of your posts and pages, such as yourdomain.com/about/. WordPress makes them work with rules stored in a hidden file called .htaccess. If those rules are missing or damaged, the home page still loads but every other address shows a 404 error (“Not Found” or “Page not found”).
Step 1: Rebuild the permalink rules
- Go to
yourdomain.com/wp-adminand log in. - Go to Settings → Permalinks. Just opening this screen refreshes WordPress’s internal rules.
- Don’t change the structure. Click Save Changes.
- Reload a page that showed the 404.
If the page now opens, you’re done. If WordPress says You should update your .htaccess file now., go to Step 2. If there’s no such message and the page still shows 404, see “When only some pages show 404” below, then clear your cache.
Step 2: Fix the .htaccess file
That message means WordPress couldn’t write to .htaccess, often because of the file’s permissions.
Note
Step 2 uses cPanel on Shared Web Hosting. If you have Managed WordPress Hosting, open a support ticket instead. If you can’t log in to cPanel or don’t have File Manager, open a support ticket.
- Log in to cPanel, click Files in the sidebar and open the File Manager tab. If you see a File Manager icon instead, click it. Or type its name in cPanel’s search box (Ctrl+K or Cmd+K).
- Click More in the toolbar and select Show hidden files (older layout: click Settings, select Show Hidden Files and click Save).
- Open
public_html(or the folder for this site). If there’s no.htaccessfile, click New File, name it.htaccessand confirm. - Select
.htaccessand click Permissions. If the number isn’t644, change it to644and confirm. - Go back to Settings → Permalinks and click Save Changes again. If the 404 page now opens, you’re done.
If WordPress still says to update .htaccess, paste the rules in yourself.
Warning
Save a copy of the file on your computer before you change it (steps 1 and 2), so you can undo your change.
- In File Manager, select
.htaccess, click More and choose Edit. - Press Ctrl + A (⌘ + A on a Mac) to select all the text, then Ctrl + C (⌘ + C) to copy it. Paste it into a Notepad or TextEdit document on your computer and save that document.
- Switch to the Permalinks screen. Click in the Rewrite rules: box near the bottom, press Ctrl + A (⌘ + A), then Ctrl + C (⌘ + C).
- Switch back to the
.htaccesseditor. If it has# BEGIN WordPressand# END WordPresslines, keep those two lines. Delete only the lines between them, and paste the rules in their place. - If those lines aren’t there, add a line
# BEGIN WordPress, paste the rules under it, then add# END WordPresson the next line. Leave any other rules in the file alone. - Save the file and reload the page that showed the 404. Still 404? Open a support ticket with the page address.
When only some pages show 404
- One post or page: check it’s published, not draft or trash, and that its address (slug) is what you expect.
- After changing the permalink structure: old links now point nowhere. Add redirects from the old addresses with a redirection plugin, or change the structure back.
- Custom content types such as products or portfolios: this often follows installing or updating the plugin that adds them. Repeat Step 1.
- An old link from another website or search results: the page really has moved. Redirect it to the new address.
How to tell it worked
Posts, pages and category links open in a private browser window instead of “Page not found”.
Troubleshooting
- The site shows a 500 error after editing .htaccess: open
.htaccesswith Edit, replace everything with the copy you saved on your computer, and save. Then see how to fix 403 and 500 errors. - File Manager won’t save .htaccess: open a support ticket.
- The fix works for you but visitors still see 404: clear your cache (see how to clear your WordPress cache).
- The WordPress block keeps disappearing: a plugin may be rewriting the file. Check the settings of recently added security or redirect plugins for an .htaccess option; if you’re not sure, open a support ticket.
Still need help?
Open a support ticket from the Client Portal at my.bluearctic.com. Include the address of a page that shows 404, your permalink setting, whether you changed anything recently, a screenshot, and what you already tried. Never include a password.