先建立一个nginx.conf 文件,然后填入以下内容:
location / { index index.html index.php; 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; } } rewrite /wp-admin$ $scheme://$host$uri/ permanent;
二级目录下静态化
location /idcnews/ { index index.html index.php; 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 (.*) /idcnews/index.php; } }
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容