• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue htaccess to nginx Not Working (WordPress 404s)

Mark Bailey

Basic Pleskian
Hi All,

The htaccess to nginx extension is not working for us...I want to make sure we're not missing something.

We have done multiple tests where users create a new WordPress install, then switch it from Apache to nginx in Plesk. Upon moving to nginx, all sub-pages throw 404 errors if WordPress permalinks are active. Of course the issue is that permalinks use .htaccess, so apparently the extension is not converting .htaccess directives to nginx syntax. It was our understanding that this extension does all this "automagically," though I can't remember where I saw that.

Or is there something that needs to be done in a certain order with each site? We are trying to make things as easy and automatic as possible for our hosting clients.

Thanks,

Mark
 
extension does all this "automagically"
Hello Mark,

Unfortunately htaccess to nginx does no magic with existing htaccess files. One needs to proceed to 'Websites & Domains' -> 'Apache & nginx Settings' and put some additional configuration to make Wordpress permalinks work on nginx. The extension will help you to convert your htaccess content into nginx configs, that you may apply on the same screen.

Typical Wordpress rewrites should be converted to
Code:
#ignored: "-" thing used or unknown variable in regex/rew
if (!-f $request_filename){
    set $rule_1 1$rule_1;
}
if (!-d $request_filename){
    set $rule_1 2$rule_1;
}
if ($rule_1 = "21"){
    rewrite /. /index.php last;
}

If you install Wordpress into a subfolder of your website document root, rewrite should be `rewrite /. /<SUBFOLDER>/index.php last;`

You may also configure your Service Plan to automatically set these directives (at Web Server tab) and install Wordpress (at Additional Services tab). Existing sites should be fixed manually though.
 
Back
Top