lovelife 发表于 2012-7-28 22:46:51

求助:在网站子目录中加一个blog,LNMP的配制文件不起作用

服务器架构LNMP,独立VPS,近来想在子目录中装个WP,可一访问总是出现505找不到错误,求大侠指点啊,在网上查了半天,应该也没有什么错误。。配制文件如下:server

{

listen       80;

server_name lacewigsfront.com www.lacewigsfront.com;

index index.html index.htm index.php default.html default.htm default.php;

root/home/wwwroot/sites;


if ($host != 'www.lacewigsfront.com') {
            rewrite ^/(.*)$ http://www.lacewigsfront.com/ $1 permanent ;
      }



include prestarshop.conf;


error_page 404 = http://www.lacewigsfront.com/ ;


location /blog/ {

root   /home/wwwroot/sites/blog;

    indexindex.php index.html;


    if ($request_uri ~* ^.*/.*$) {

   rewrite ^/(\w*)/(.*)$ /$1/index.php?q=$2 last;

   break;

    }

}



VPS新手,如问题过于简单,请谅解。。

licess 发表于 2012-7-29 11:05:17

没必要叫location /blog/,如果是wp,要用伪静态用wp2.conf 就行了,把wp2.conf里的目录改成你的就行

lovelife 发表于 2012-7-29 13:44:42

感谢军哥啊,我试试。。
页: [1]
查看完整版本: 求助:在网站子目录中加一个blog,LNMP的配制文件不起作用