Applicable to:
- Plesk for Linux
Symptoms
-
Redirection rules and other settings defined in
.htaccess
file are not applied on a website in Plesk for Linux -
It is not possible to choose PHP handler served by Apache in Plesk > Domains > example.com > PHP settings;
Cause
The option Proxy mode is turned off in Domains > example.com > Apache & nginx Settings > nginx settings
When the Proxy mode is disabled, Apache is turned off and the site will be handled by Nginx which doesn't work with .htaccess
files
Resolution
Apply one of the following possible solutions:
-
Go to Domains > example.com > Apache & nginx Settings > nginx settings > Enable the option Proxy mode > Click OK to apply the changes
.htaccess
file to Nginx-
Install the Plesk extension: htaccess to nginx
-
Convert the content of
.htaccess
file to nginx additional directives in Domains > example.com > Apache & nginx Settings > Additional nginx directives > Click OK to apply the changes
Comments
8 comments
Hi,
Mention only about adding these attributes.
exemple:
Options +FollowSymLinks
RewriteEngine On
ErrorDocument 404 /error/404.htm
ErrorDocument 500 /error/500.htm
Hello Matthias Ulewicz
Sorry for the late response but could you, please, clarify your request?
If you need to convert the mentioned directives, try using the extension mentioned in this article.
Hi Everyone
I have a problem with the htaccess. The main concern is, when Im using the preview website, the htaccess works, but as soon im using the real domain it's not.
do you have any clue?
I have tried checking the tick box in nginx settings to enable proxy mode but this didn't help.
Tried the htaccess to nginx converter but the server didn't like the code produced.
Any suggestions ?
Hello, Martin Corby
I would recommend checking if the rewrite module is enabled:
In case the command will return "rewrite off", execute this one to enable the module:
Stefan - Thanks for your time.
Checked the above and the server responded : rewrite on
Hi Stefan Yakubov ,
This seems to me as a possible ill design code, involving a possible Plesk Bug.
The proxy is enabled on our server, yet, such bypassing of filters happens.
It seems to me, the 'server' directive 301 routing supersede some filters although they should not.
A log showing to where is the 301 routing pointing, when a filter (403?) was expected, could be very helpful.
Hello, Ehud Ziegelman
Considering the fact that the .htaccess is created rather manually, or by the application, it is outside of the Plesk logic, and thus cannot be considered a bug, when proxy mode in Plesk is disabled.
You can create a uservoice request, for example, a feature that will notify the user during the proxy mode disabling, that there are .htaccess files within the domain's document root.
Please sign in to leave a comment.