server
{
...
location / {
#启用rewrite
if (!-e $request_filename) {
rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last;
rewrite ^([_0-9a-zA-Z-]+)?(/.*\.php)$ $2 last;
rewrite ^ /index.php last;
}
}
...
}
#apache 启用 rewrite module
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so