VPS侦探论坛

 找回密码
 注册
查看: 7257|回复: 5

求教nginx伪静态!!!加急!!!

[复制链接]
发表于 2010-12-27 11:50:44 | 显示全部楼层 |阅读模式

linux vps 用的lnmp nginx/0.8.52
根目录下装有wordpress
       /shop/目录下装有一淘客程序
2个程序都需设置伪静态规则,单独使用规则都没有问题,如果添加wordpress伪静态,子目录下的规则就失效了。
请教如何使2个规则同时有用,即子目录下的伪静态如何设置。
具体配置如下,
----------------wordpress.conf----------------
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;                                    《-------------------估计这句有冲突,请教如何改?
}
----------------taoke.conf----------------
rewrite (.+)product\.php/([0-9]+)\.html$ $1product.php?iid=$2 last;
rewrite (.+)list\.php/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.+)-([0-9]+)\.html$ $1list.php?catid=$2&sortnum=$3&sp=$4&ep=$5&q=$6&page=$7 last;
rewrite (.+)list\.php/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.+)\.html$ $1list.php?catid=$2&sortnum=$3&sp=$4&ep=$5&q=$6 last;
rewrite (.+)list\.php/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-\.html$ $1list.php?catid=$2&sortnum=$3&sp=$4&ep=$5 last;
rewrite (.+)list\.php/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-\.html$ $1list.php?catid=$2&sortnum=$3&sp=$4&ep=$5 last;
rewrite (.+)list\.php/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1list.php?catid=$2&sortnum=$3&sp=$4&ep=$5 last;
rewrite (.+)list\.php/([0-9]+)-([0-9]+)\.html$ $1list.php?catid=$2&sortnum=$3 last;
rewrite (.+)list\.php/([0-9]+)\.html$ $1list.php?catid=$2 last;

rewrite (.+)shop\.php/(.+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/shop.php?user=$2&sortnum=$3&sp=$4&ep=$5&page=$6 last;
rewrite (.+)shop\.php/(.+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/shop.php?user=$2&sortnum=$3&sp=$4&ep=$5 last;
rewrite (.+)shop\.php/(.+)-([0-9]+)\.html$ $1/shop.php?user=$2&sortnum=$3 last;
rewrite (.+)shop\.php/(.+)\.html$ $1/shop.php?user=$2 last;
域名conf文件,已添加以上2个配置文件。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-12-27 11:55:27 | 显示全部楼层


伪静态中路径错误,参考https://bbs.vpser.net/thread-1977-1-1.html
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-12-27 16:27:18 | 显示全部楼层

已经改为如下规则,仍旧无效。再麻烦看看 谢谢
====================taobao.conf======================
location /shop/ {
rewrite (.+)/shop/product\.php/([0-9]+)\.html$ $1/shop/product.php?iid=$2 last;
rewrite (.+)/shop/list\.php/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.+)-([0-9]+)\.html$ $1/shop/list.php?catid=$2&sortnum=$3&sp=$4&ep=$5&q=$6&page=$7 last;
rewrite (.+)/shop/list\.php/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.+)\.html$ $1/shop/list.php?catid=$2&sortnum=$3&sp=$4&ep=$5&q=$6 last;
rewrite (.+)/shop/list\.php/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-\.html$ $1/shop/list.php?catid=$2&sortnum=$3&sp=$4&ep=$5 last;
rewrite (.+)/shop/list\.php/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-\.html$ $1/shop/list.php?catid=$2&sortnum=$3&sp=$4&ep=$5 last;
rewrite (.+)/shop/list\.php/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/shop/list.php?catid=$2&sortnum=$3&sp=$4&ep=$5 last;
rewrite (.+)/shop/list\.php/([0-9]+)-([0-9]+)\.html$ $1/shop/list.php?catid=$2&sortnum=$3 last;
rewrite (.+)/shop/list\.php/([0-9]+)\.html$ $1/shop/list.php?catid=$2 last;

rewrite (.+)/shop/shop\.php/(.+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/shop/shop.php?user=$2&sortnum=$3&sp=$4&ep=$5&page=$6 last;
rewrite (.+)/shop/shop\.php/(.+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/shop/shop.php?user=$2&sortnum=$3&sp=$4&ep=$5 last;
rewrite (.+)/shop/shop\.php/(.+)-([0-9]+)\.html$ $1/shop/shop.php?user=$2&sortnum=$3 last;
rewrite (.+)/shop/shop\.php/(.+)\.html$ $1/shop/shop.php?user=$2 last;
}
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-12-27 19:28:43 | 显示全部楼层

回复 3# 的帖子




那可能是你伪静态有问题
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-12-28 11:26:39 | 显示全部楼层

我用的都是官方给出的规则,
军哥能否帮忙帮忙写一条规则,不甚感激
静态地址  http://mvmv.tk/shop/product.php/7349905126.html
动态地址  http://mvmv.tk/shop/product.php?iid=7349905126

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

发表于 2010-12-28 15:25:39 | 显示全部楼层

回复 5# 的帖子


location /shop/ {
            rewrite ^/shop/product.php/([0-9]+)\.html)$ /shop/product.php?iid=$1 last;
        }
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-23 12:49 , Processed in 0.026820 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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