VPS侦探论坛

 找回密码
 注册
查看: 8101|回复: 2

请教nginx伪静态弄来弄去一直404

[复制链接]
发表于 2011-3-31 18:53:41 | 显示全部楼层 |阅读模式

前天装的lnmp一键包,做了几个站,基本都是动态的,今天装了个站,开启伪静态,除了首页,其他页面都是404
404 Not Foundnginx/0.7.67
我说下我的步骤,高手们指点下哪里错了,我看了网上的一些教程首先我用sftp进入/usr/local/nginx/conf/vhost/ 目录下,找到我的 域名.conf文件,下载-编辑


打开域名.conf文件,该域名调用的伪静态规则文件是fcgi.conf于是下载fcgi.conf 文件编辑 在下面添加我的伪静态规则
location / {
rewrite "^(.*)sort_([0-9]+)_([0-9]+).html$" $1sort.php?sortid=$2&page=$3 last;rewrite "^(.*)over_([0-9]+).html$" $1over.php?page=$2 last;rewrite "^(.*)top_(.*)_([0-9]+).html$" $1top.php?topid=$2&page=$3 last;rewrite "^(.*)topover_(.*)_([0-9]+).html$" $1topover.php?topid=$2&page=$3 last;rewrite "^(.*)book_([0-9]+).html$" $1book.php?bookid=$2 last;rewrite "^(.*)down_(.*)_([0-9]+).html$" $1down.php?bookid=$3&type=$2 last;rewrite "^(.*)readend_([0-9]+).html$" $1readend.php?bookid=$2 last;rewrite "^(.*)read_([0-9]+)_([0-9]+).html$" $1read.php?cutid=$2&bookid=$3 last;rewrite "^(.*)chapter_([0-9]+)_([0-9]+)_([0-9]+).html$" $1chapter.php?cutid=$2&bookid=$3&chapterid=$4 last;};



添加后上传 /usr/local/nginx/sbin/nginx -s reload ssh输入指令,重启nginx 打开网站,伪静态页面仍然404
高手指点下!!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-3-31 19:12:21 | 显示全部楼层

回复 1# 的帖子



伪静态添加问题
请阅读http://lnmp.org/install.html
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-3-31 21:19:07 | 显示全部楼层

回复 2# 的帖子


悲剧了,我是添加域名后添加伪静态的
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-20 06:09 , Processed in 0.025304 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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