How to keep .htaccess rules after switching PHP handler from Apache to nginx in

Started by Suhitha, Oct 21, 2025, 07:19 AM

Previous topic - Next topic

Suhitha

Applicable to:

  • Plesk for Linux


Question

How to keep .htaccess rules after switching PHP handler from Apache to nginx?


Answer

Prior to switching to nginx:

1.Log in to Plesk as admin user

2.Install htaccess-to-nginx converter extension: How to install Plesk extension

3.Go to Domains > example.com > Apache & nginx Settings > Additional nginx directives and click a link as below:



4.Insert the content of .htaccess file and press Convert to nginx button

5.Click OK to save the changes

Note: a featue request to automate htaccess to nginx directives conversion is available here. Feel free to vote for it to be implemented in future Plesk releases.