Cobra Forum

Plesk Panel => Others => Topic started by: mahesh on Feb 14, 2025, 05:28 AM

Title: WordPress website returns a 404 Page Not Found error on internal pages and posts
Post by: mahesh on Feb 14, 2025, 05:28 AM
Symptoms
Cause
A Wordpress website that is hosted on an Apache web server requires the existence of a default .htaccess file within its main directory. If this file is missing or has improper content, such 404 errors are expected.

Resolution
1. Log into Plesk

2. Go to Domains > example.com > Dashboard > Files

3. Navigate to the main directory of the WP installation

4. Add the default WordPress .htaccess rewrite rules in the .htaccess file that resides within the main directory of the website:

# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
Once this is done, the internal pages and posts of the WP installation will be displayed properly.