wordpress子目录伪静态设置

网站访问目录为http://show.abc.com/ ,但是wordpress是装在他下面的manage目录中的,所以访问到的首页也该是http://show.abc.com/manage/

而wordpress默认访问文章的URL是http://show.abc.com/manage/?p=12 的形式,需要做伪静态使文章访问形式为http://show.abc.com/manage/12 

在nginx中配置如下:

server {
                listen  80;
                server_name     show.abc.com;
                access_log      logs/access_show.abc.com.log;
                error_log       logs/error_show.abc.com.log;

                index   index.html index.php;

                location / {
                        root    /web/html/show;
                }

                location /manage/ {
                        try_files $uri $uri/ /manage/index.php;
                }

                location /manage/wp-content {
                        alias   /web/html/show/manage/wp-content;
                }
                location /manage/wp-includes {
                        alias   /web/html/show/manage/wp-includes;
                }
                location /manage/wp-admin {
                        alias   /web/html/show/manage/wp-admin;
                }

                location ~ \.php$ {
                        root           /web/html/show;
                        fastcgi_pass   127.0.0.1:9001;
                        fastcgi_param  SCRIPT_FILENAME  /web/html/show$fastcgi_script_name;
                        include        fastcgi_params;
                }
        }

 

版权声明:
作者:admin
链接:https://www.chenxie.net/archives/741.html
来源:蜀小陈
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>