PrestaShop friendly URLs stop working or return a 404 error
PrestaShop’s friendly URLs rely on the web server’s URL rewriting, switched on under Preferences > SEO & URLs. On Apache, that means a regenerated .htaccess file; on Nginx, there’s no .htaccess, and the rules have to be written manually into the server configuration. A site-wide 404 after activation, and a URL change that breaks already-indexed links, each have their own cause.
Why the same setting behaves differently by host
The Enable friendly URLs setting, under Preferences > SEO & URLs, relies on the web server’s URL rewrite module. On Apache, turning it on regenerates a .htaccess file at the site root, and mod_rewrite needs to be active on the server for it to take effect.
On Nginx, there’s no .htaccess file: the rewrite rules have to be translated manually into the server configuration. That’s why the same tickbox works on one host and does nothing on another: the mechanism applying it isn’t the same.
Site-wide 404 after activation
A 404 error on every page, right after turning on friendly URLs, very often comes from a .htaccess that hasn’t been regenerated, or has been overwritten by a server-side change: a host switch, a backup restore, an update. The regeneration button, in the same settings screen, recreates the file with up-to-date rules.
Changing the product URL format after the fact, or switching domain name, breaks every link already shared or indexed by Google: without 301 redirects set up for each old address, those links fall into a 404 instead of redirecting to the new page.
What I check depending on the symptom
-
Apache or Nginx
The server type determines whether the fix is regenerating a .htaccess file or editing the server configuration itself.
-
The current .htaccess file
I check whether it’s been regenerated since the last change to the site or hosting, and whether it matches the URL structure actually in place.
-
The scale of broken links
I list the old URLs still being requested, via server logs or Search Console, to gauge whether case-by-case redirects are enough or a bulk policy is needed.
Related pages
-
500 error or blank page on PrestaShop
A different family of server errors, with its own causes and its own diagnostic method.
-
PrestaShop 1.6 to 1.7 or 8 migration
A version or hosting change is often the moment friendly URLs break.
-
Custom PrestaShop module development
For a bulk 301 redirect policy, often carried out directly at database level.
Describe your need in one minute
A few targeted questions so I can reply with an estimate rather than another questionnaire.