Not Found 404 error on a WordPress post URL

WordPress Posts Showing 404 Errors? Fix Permalinks and .htaccess

Tested in the ShoHost fix lab on 12 October 2026: WordPress 7.1.3, PHP 8.4, Apache with MariaDB 11.8. Every screenshot below is from that lab, not from a customer site.

Your homepage opens, but every post and page returns 404 Not Found. When this happens on Apache or LiteSpeed, the rewrite rules in .htaccess are usually missing or broken. It often follows a migration, a security plugin edit, or restoring files without hidden files.

Not Found 404 error on a WordPress post URL
A normal post URL returning 404 after .htaccess went missing.

Why it happens

“Pretty” permalinks such as /my-post/ don’t exist as real files. The .htaccess rules pass those requests to index.php. Without them, the web server looks for a folder that isn’t there and gives up.

Terminal showing .htaccess missing while permalink structure is set
The permalink structure was set to /%postname%/, but .htaccess didn’t exist.

Fix 1: Save permalinks again (works most of the time)

Go to wp-admin → Settings → Permalinks and click Save Changes without changing anything. WordPress rewrites .htaccess as long as the file is writable.

WordPress Settings Permalinks screen with Post name selected
Settings → Permalinks
Permalink structure updated confirmation in WordPress
After saving, WordPress confirmed the update and recreated .htaccess.
Regenerated WordPress .htaccess rewrite rules
The regenerated rules. The post now returns HTTP 200.
WordPress post loading correctly after fixing permalinks
The post loads again.

Fix 2: Create .htaccess by hand

If saving doesn’t work (for example because the file isn’t writable), open cPanel File Manager, turn on Show Hidden Files, and create or edit public_html/.htaccess with the standard WordPress rules:

# 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

Use 644 permissions for the file. If WordPress lives in a subfolder, change RewriteBase and the last rule to match, for example /blog/ and /blog/index.php. Then purge LiteSpeed Cache or whichever cache plugin you use.

Need a hand?

Want someone to do this for you? If your site is on ShoHost, message our support team on WhatsApp at +91 94880 91432 or email [email protected] and we’ll look at the error log with you. Hosting somewhere else and tired of errors like this one? ShoHost WordPress hosting runs on LiteSpeed servers with NVMe storage and free SSL, and includes free migration.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *