skip to Main Content

I have changed permalink settings in my WordPress website and now all pages return 404 error.
I have tried the following (none of them worked for me)

  1. Removing .htaccess file and change permalink configuration from WordPress admin panel so it overrites the file with a correct .htaccess configuration
  2. Cheching whether Apache2 server has Allow Override directive (It has the directive enabled)
  3. Checking file permissions (they are okey — -rw-r–r– )
  4. Uninstalling all plugins

Rest api error 404 while trying to configurate WooCommerce

2

Answers


  1. Try calling flush_rewrite_rules (https://developer.wordpress.org/reference/functions/flush_rewrite_rules/).

    Just put it into your active theme’s functions.php file (e.g. at the beginning) and refresh your page. Then remove it.

    Login or Signup to reply.
  2. Go to Settings » Permalinks, and simply click on the Save Changes button. This will update your permalinks settings and flush rewrite rules. In most cases, this solution fixes the WordPress posts 404 error. However, if it does not work for you, then you probably need to update your .htaccess file manually.

    You can also manually add this code in your .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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search