如下面的例子,假设放在yuanzifan.com的子目录
这Ngnix的子目录伪静态设置如下:
具体操作的时候,替换掉yuanzifan.com。变成你自己的子目录文件夹名即可
注:此操作适用于Nginx
- location /yuanzifan.com/ {
- 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 (.*) /yuanzifan.com/index.php;
- }
- }
注意,此时前台已经伪静态成功,而后台依然不可用。报404,同样是子目录的问题,需要在后面加上下面的后台伪静态代码:文章源自原紫番博客-https://www.yuanzifan.com/54767.html
- rewrite /wp-admin$ $scheme://$host$uri/ permanent;
如果后台不是wp-admin,同样要改成对应的后台目录。
文章源自原紫番博客-https://www.yuanzifan.com/54767.html
文章源自原紫番博客-https://www.yuanzifan.com/54767.html
站长微信
扫码添加(注明来意)

Yuanzifan99
原梓番博客公众号
博客内容精选

原梓番博客
评论