coo 发表于 2010-9-21 15:04:16

nginx伪静态老是出错,纠结啊

server
        {
                listen       80;
                server_name www.sudua.com;
                index index.html index.htm index.php;
                root/home/sudua;
      include location.conf;
        location / {
rewrite ^file-(+)\.html$ viewfile.php?file_id=$1 last;
rewrite ^viewfile-(+)-(*)\.html$ downfile.php?action=view&file_id=$1&file_key=$2 last;
rewrite ^downfile-(+)-(*)\.html$ downfile.php?file_id=$1&file_key=$2 last;
rewrite ^space-(.+)\.html$ space.php?username=$1 last;
                   }
        }不知道什么地方有问题!~~~来人指教下
程序5.1的

along 发表于 2010-9-21 15:31:42

rewrite ^(.*)/file-(+)\.html$ $1/viewfile.php?file_id=$2 last;
rewrite ^(.*)/viewfile-(+)-(*)\.html$ $1/downfile.php?action=view&file_id=$2&file_key=$3 last;
rewrite ^(.*)/publicfile\.html$ $1/public.php last;
rewrite ^(.*)/downfile-(+)-(*)\.html$ $1/downfile.php?file_id=$2&file_key=$3 last;
rewrite ^(.*)/publicfile-(+)-(+)\.html$ $1/public.php?pid=$2&cate_id=$3 last;
rewrite ^(.*)/space-(.+)\.html$ $1/space.php?username=$2 last;

coo 发表于 2010-9-21 15:43:36

server
        {
                listen       80;
                server_name www.sudua.com;
                index index.html index.htm index.php;
                root/home/sudua;
      include location.conf;
        location / {
rewrite ^(.*)/file-(+)\.html$ $1/viewfile.php?file_id=$2 last;
rewrite ^(.*)/viewfile-(+)-(*)\.html$ $1/downfile.php?action=view&file_id=$2&file_key=$3 last;
rewrite ^(.*)/publicfile\.html$ $1/public.php last;
rewrite ^(.*)/downfile-(+)-(*)\.html$ $1/downfile.php?file_id=$2&file_key=$3 last;
rewrite ^(.*)/publicfile-(+)-(+)\.html$ $1/public.php?pid=$2&cate_id=$3 last;
rewrite ^(.*)/space-(.+)\.html$ $1/space.php?username=$2 last;
                   }
        }升级到9.13版本 依然出错 404 闷哦 DZ等程序伪静态设置正常
页: [1]
查看完整版本: nginx伪静态老是出错,纠结啊