How to Fix WordPress Posts Returning 404 Error when choose permalink in settings ?

wordpress setup

While doing wordpress migration from server to server the 404 error is common. In this article we will show how to fix the wordpress post
404 error.

Temporarily disable the cache, if you used anything. Until the problems resolved.

Change the setting in the server

sudo chown www-data /var/www/html/recipe/.htaccess

Change the setting in the CONF (If it’s apache)

  1. Open the conf file /etc/apache2/apache2.conf
  2. Update the settings in AllowOverride parameters

<Directory /var/www/>

        Options Indexes FollowSymLinks

        AllowOverride All

        Require all granted

</Directory>

 

Add the below code in .htaccess file

# 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

Restart the apache & it will work

Related posts

Leave a Comment