Under Nginx have WordPress support fixed link pseudo static rules

  • 2020-05-06 12:17:09
  • OfStack

Under Nginx, let WordPress support the pseudo-static rule

for fixed links

To make nginx support wordpress fixed links is simple, you need to do the add point configuration code yourself:


location / {
if (-f $request_filename/index.html){
                rewrite (.*) $1/index.html break;
        }
if (-f $request_filename/index.php){
                rewrite (.*) $1/index.php;
        }
if (!-f $request_filename){
                rewrite (.*) /index.php;
        }
}

Then, restart lnmp and the command is:

# ~ : nginx restart


Related articles: