VPS侦探论坛

 找回密码
 注册
查看: 4031|回复: 4

请军哥帮忙看一下我的伪静态哪里错了,谢谢

[复制链接]
发表于 2016-4-24 08:58:22 | 显示全部楼层 |阅读模式

伪静态,conf文件里面的内容是这样的
  1. location / {
  2. rewrite ^(.*)/f_(.*)_(.*)$ $1/thread.php?fid=$2;page=$3 last;
  3. rewrite ^(.*)/f_(.*)$      $1/thread.php?fid=$2 last;
  4. rewrite ^(.*)/(.*)_(.*)_(.*).html$  $1/read.php?tid=$2;page=$3;fpage=$4  last;
  5. rewrite ^(.*)/(.*)_(.*).html$       $1/read.php?tid=$2;page=$3  last;
  6. rewrite ^(.*)/(.*).html$         $1/read.php?tid=$2 last;
  7. rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
  8.         }
复制代码



lnmp restart后就出现错误,请问是不是我的伪静态写的不对?我是网上搜索到的,看别人的回复有成功的,不知道我的错在哪里,请帮忙看看。
  1. +-------------------------------------------+
  2. |    Manager for LNMP, Written by Licess    |
  3. +-------------------------------------------+
  4. |              http://lnmp.org              |
  5. +-------------------------------------------+
  6. Stoping LNMP...
  7. Stoping nginx... nginx: [emerg] unknown directive "page=$3" in /usr/local/nginx/conf/phpwind.conf:2
  8. failed. Use force-quit
  9. Shutting down MySQL.                                       [  OK  ]
  10. Gracefully shutting down php-fpm . done
  11. Starting LNMP...
  12. Starting nginx... nginx (pid 4380 4377) already running.
  13. Starting MySQL..                                           [  OK  ]
  14. Starting php-fpm  done
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-4-24 11:16:15 | 显示全部楼层


你这是什么程序,伪静态有问题里面有 ; 这个在nginx里是一行结束。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-4-24 17:49:45 | 显示全部楼层

谢谢军哥我的是PHPWIND的程序,我修改的帖子是参照这个
http://www.phpwind.net/read/702531
看了你的回复,我把原来的
  1. rewrite ^(.*)/_(.*)_(.*)$ $1/thread.php?fid=$2;page=$3 last;
  2. rewrite ^(.*)/_(.*)$      $1/thread.php?fid=$2 last;
  3. rewrite ^(.*)/(.*)_(.*)_(.*).html$  $1/read.php?tid=$2;page=$3;fpage=$4  last;
  4. rewrite ^(.*)/(.*)_(.*).html$       $1/read.php?tid=$2;page=$3  last;
  5. rewrite ^(.*)/(.*).html$         $1/read.php?tid=$2 last;
  6. rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
复制代码



改成这样了
  1. rewrite ^(.*)/_(.*)_(.*)$ $1/thread.php?fid=$2 last;
  2. rewrite ^(.*)/_(.*)$ $1/thread.php?fid=$2 last;
  3. rewrite ^(.*)/(.*)_(.*)_(.*).html$ $1/read.php?tid=$2 last;
  4. rewrite ^(.*)/(.*)_(.*).html$ $1/read.php?tid=$2 last;
  5. rewrite ^(.*)/(.*).html$ $1/read.php?tid=$2 last;
  6. rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
复制代码

;后面的都删了,测试了一下能实现伪静态了,不知道这样有没有后遗症,请帮忙看一下。谢谢
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-4-25 09:49:09 | 显示全部楼层

回复 3# 的帖子




这个不清楚是否会有后遗症,你可以多测试看看
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-4-25 10:40:57 | 显示全部楼层

好的,谢啦……

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

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-29 05:29 , Processed in 0.026352 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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