Ubuntu 18.04 WordPress

Fixed : WordPress, Permalink post name not working,404 error

Easy fix for Permalink post name not working, 404 error

If you are facing any of such issue like:

  • The REST API call gave the following unexpected result: (404)
  • Publishing failed. Error message: The response is not a valid JSON response.
  • Permalink post name not working, but plain permalink is working
sudo a2enmod rewrite
sudo service apache2 restart
# 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]

# END WordPress
sudo service apache2 restart
sudo nano /etc/apache2/apache2.conf
<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.