VPS侦探论坛

 找回密码
 注册
查看: 8761|回复: 3

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

[复制链接]
发表于 2011-2-9 11:53:07 | 显示全部楼层 |阅读模式

在的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是



  1. server
  2. {
  3.   listen       80;
  4.   server_name www.tpimage.net;
  5.   index index.html index.htm index.php default.html default.htm default.php;
  6.   root  /home/wwwroot/tpimage;
  7.   include /wordpress.conf;
  8.   location ~ .*\.(php|php5)?$
  9.    {
  10.     fastcgi_pass  unix:/tmp/php-cgi.sock;
  11.     fastcgi_index index.php;
  12.     include fcgi.conf;
  13.    }
  14.   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  15.    {
  16.     expires      30d;
  17.    }
  18.   location ~ .*\.(js|css)?$
  19.    {
  20.     expires      12h;
  21.    }
  22.   access_log off;
  23. }
复制代码



另外wordpress.conf是

  1. location / {
  2. if (-f $request_filename/index.html){
  3. rewrite (.*) $1/index.html break;
  4. }
  5. if (-f $request_filename/index.php){
  6. rewrite (.*) $1/index.php;
  7. }
  8. if (!-f $request_filename){
  9. rewrite (.*) /index.php;
  10. }
  11. }
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-2-9 12:29:07 | 显示全部楼层

回复 1# 的帖子



设置wp固定链接的时候把伪静态格式里的index.php去掉就行了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-2-12 10:06:30 | 显示全部楼层

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


就是这么简单?我试试看
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-3-27 12:03:30 | 显示全部楼层



是的,设置固定链接的时候,直接去掉就可以了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-22 15:50 , Processed in 0.025842 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表