• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    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.

Nginx with custom permalinks - Wp-login.php - Too many redirects

Xavier12

Regular Pleskian
Hey guys,

For some reason we are having nginx issues. We've used apache to nginx converter and custom permalinks do work, however, when logging in to Wordpress dashboard, we receive a "too many redirects" error. It seems to only work when we type in: http://domain.com/wp-admin/index.php

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;
}

Please advise, thanks.
 
What worked for my was adding a rule specifically targeting the /wp-admin folder

#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 ^/wp-admin/(.*)\.php$ /wp-admin/$1.php last; #<==== this line

rewrite /. /index.php last;

}
 
Back
Top