huage.org 发表于 2011-2-9 11:53:07

求助在lnmp下,非根目录设置wp的固定链接的设置--去掉index.php

在的VPS服务器环境是用lnmp0.5搭建的,所有的网站程序都放在/home/wwwroot/下,其中有一个WP博客放在/home/wwwroot/tpimage下。
我在VPS上用命令安装虚拟主机时,已天际wordpress.conf,但是当我的博客安装好后,我进入后台设置固定链接时,却多了一个index.php,例如/index.php/%year%/%monthnum%/%postname%/ ,我想把这个/index.php去掉,我尝试了许多方法都没有解决问题,是路径设置问题吗?还是其它?

问题补充:
我的WP博客放在home/wwwroot/tpimage下,其中这个网站的conf是



server
{
listen       80;
server_name www.tpimage.net;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/tpimage;
include /wordpress.conf;
location ~ .*\.(php|php5)?$
   {
    fastcgi_passunix:/tmp/php-cgi.sock;
    fastcgi_index index.php;
    include fcgi.conf;
   }
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
   {
    expires      30d;
   }
location ~ .*\.(js|css)?$
   {
    expires      12h;
   }
access_log off;
}



另外wordpress.conf是

location / {
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;
}
}

licess 发表于 2011-2-9 12:29:07

回复 1# 的帖子

设置wp固定链接的时候把伪静态格式里的index.php去掉就行了

vieway 发表于 2011-2-12 10:06:30

原帖由 licess 于 2011-2-9 12:29 发表 https://bbs.vpser.net/images/common/back.gif
设置wp固定链接的时候把伪静态格式里的index.php去掉就行了

就是这么简单?我试试看

vieway 发表于 2012-3-27 12:03:30

是的,设置固定链接的时候,直接去掉就可以了
页: [1]
查看完整版本: 求助在lnmp下,非根目录设置wp的固定链接的设置--去掉index.php