Applicable to:
- Plesk for Linux
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
/var/www/vhosts/example.com/logs/error_logthe following error is shown:CONFIG_TEXT: [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
.htaccess
file and rewrite rules from
.htaccess
are ignored.
Resolution
- Apply
/var/www/vhosts/example.com/httpdocs/.htaccessrewriting rules to Additional nginx directives under Domains > example.com > Apache and nginx settings.
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.
Comments
This tutorial its not accurate.
you must add the string of mod rewrite (in my case is wordpress)
<IfModule mod_rewrite.c>
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]
</IfModule>
and than, transform to nginx
so you apply and will work
Please sign in to leave a comment.