VPS侦探论坛

 找回密码
 注册
查看: 7302|回复: 7

Wordpress 固定链接出现404

[复制链接]
发表于 2012-8-27 14:06:27 | 显示全部楼层 |阅读模式

我的固定链接设置的是/gundam/%year%-%monthnum%/%post_id%/%postname%.html
现在只有打开首页可以打开 所有页面404  

规则为
  1. location / {
  2.         if (-f $request_filename/index.html){
  3.                 rewrite (.*) $1/index.html break;
  4.         }

  5.         if (-f $request_filename/gundam/index.php){
  6.                 rewrite (.*) $1/index.php;
  7.         }

  8.         if (!-f $request_filename){
  9.                 rewrite (.*) /index.php;
  10.         }

  11. }
复制代码
地址是:http://www.xhood.net/
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-8-27 15:48:06 | 显示全部楼层


wp固定链接好像不能加目录吧,只能他指定的参数吧
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-8-30 14:16:16 | 显示全部楼层

回复 2# 的帖子


军哥  不加目录也不能用 用默认的上面几个形式都是404
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-8-30 14:46:17 | 显示全部楼层



如果你添加虚拟主机时没选上wp的伪静态,肯定是不行的。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-8-30 15:06:33 | 显示全部楼层

回复 4# 的帖子


军哥 肯定加吖 include wordpress.conf;  规则就是上面贴的

军哥运维代购:http://shop63846532.taobao.com/

发表于 2012-8-30 15:53:02 | 显示全部楼层

wordpress.conf 是你修改过的,要用原版的
 楼主| 发表于 2012-8-31 08:53:35 | 显示全部楼层

[quote]原帖由 licess 于 2012-8-30 15:53 发表
wordpress.conf 是你修改过的,要用原版的 [/quote

location / {
        if (-f $request_filename/index.html){
                rewrite (.*) $1/index.html break;
        }

        if (-f $request_filename/gundam/index.php){
                rewrite (.*) $1/index.php;
        }

        if (!-f $request_filename){
                rewrite (.*) /index.php;
        }

}

这个不是原版吗、?原版不能用]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-8-31 10:23:53 | 显示全部楼层

自己重新下一个安装包看看
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-23 17:25 , Processed in 0.027067 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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