1. Home
  2. CMS/Applications
  3. How to Correct a 404 Error on All WordPress and Prestashop Pages

How to Correct a 404 Error on All WordPress and Prestashop Pages

This article explains what to do if all your pages return 404 errors except your main page.

Procedure for WordPress

  1. Go to File Manager.
  2. Locate your WP .htaccess file (you may need to enable the option to view hidden files).
  3. Make a backup copy of this file in case things go wrong.
  4. Replace the contents of the .htaccess file with the following code:
# 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
  1. The 404 error should disappear.
  2. If this does not work, repeat step 4 as follows: in your WP administration, select Settings -> Permalinks and save. This will regenerate the .htaccess file.

If necessary, you can refer to the documentation available at this link : https://developer.wordpress.org/advanced-administration/server/web-server/httpd/.

Procedure for Prestashop

  1. Go to File Manager.
  2. Rename your Prestashop .htaccess files to .htaccess.old (you may need to enable the option to view hidden files).
  3. In your Prestashop administration, select Preferences -> SEO and URLs, deactivate Friendly URLs and click on the Save button.
  4. Reactivate Friendly URLs afterwards and save again.
  5. This will regenerate the .htaccess file.
Updated on September 16, 2024

Related Articles