Symptoms
- Domain is inaccessible with 404 error.
Rewrite rules specified in
/var/www/vhosts/example.com/httpdocs/.htaccessfile do not work. - FPM application served by nginx handler is set in Domains > example.com > PHP Settings .
- In
the following error is shown:
/var/www/vhosts/example.com/logs/error_log
[error] 20463#0: *1329372 "/var/www/vhosts/example.com/httpdocs/en/component/users/index.html" is not found (2: No such file or directory)
Cause
When FPM application served by nginx is enabled, the website stops using file and rewrite rules from
.htaccess
are ignored.
.htaccess
Resolution
- Apply
rewriting rules to Additional nginx directives under Domains > example.com > Apache and nginx settings.
/var/www/vhosts/example.com/httpdocs/.htaccess
If these are CMS-based websites like WordPress or Joomla, apply the steps from the article After switching a WordPress website to FPM served by nginx in Plesk, it fails to load with "404 Not Found" on all pages except start page.
Note: rewrite rules should be formed according to nginx syntax.
- Another solution is to change PHP support for domain from FPM application served by nginx to FPM application served by Apache under Domains > example.com > PHP Settings.
Alternatively, try to convert Apache rules to nginx using htaccess to nginx extension.
To install the extension check the article How to manage Plesk extensions (install, disable, remove, update)
Note: This extension is experimental. Always check the conversion results manually to prevent possible issues.