ppmm 发表于 2012-1-9 12:25:43

lnmp无论我那种方式设置conf文件,用工具检测http状态都是301

带www跟不带www 的,无论用那个conf文件,测速时都是显示http状态是301,是测速网站错了?还是怎么的,我用了17ce跟webkaka两个都测了;另外我又找了几个检测网站测了http状态还是301,有什么办法解决不?

一种方式的conf:
server
      {
                listen       80;
                server_name www.xxx.comxxx.com ;
                index index.html index.htm index.php default.html default.htm default.php;
                root/home/wwwroot/111;

                include none.conf;
                location ~ .*\.(php|php5)?$
                        {
                              fastcgi_passunix:/tmp/php-cgi.sock;
                              fastcgi_index index.php;
                              include fcgi.conf;
                        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                              expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                              expires      12h;
                        }

                access_log off;
      }

另一种方式的:
server
      {
                listen       80;
                server_name www.xxx.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root/home/wwwroot/111;

                include none.conf;
                location ~ .*\.(php|php5)?$
                        {
                              fastcgi_passunix:/tmp/php-cgi.sock;
                              fastcgi_index index.php;
                              include fcgi.conf;
                        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                              expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                              expires      12h;
                        }

                access_log off;
      }
server {
server_name xxx.com;
rewrite ^(.*) http://www.xxx.com$1 permanent;
}

licess 发表于 2012-1-9 12:53:32

第一种不会301,第二种会301

你测试/usr/local/nginx/sbin/nginx -t测试看看

ppmm 发表于 2012-1-9 14:36:10

回复 2# 的帖子

军哥,按道理来说,第一种应该是两个都不是301;第二种应该只有一个网站是301,对吧?现在我的情况是,无论用那一种,都是两个网站都是301
所以才觉得见鬼了

我测试/usr/local/nginx/sbin/nginx -t了,提示是successfully

licess 发表于 2012-1-9 17:15:41

回复 3# 的帖子

的确怪诡异

ppmm 发表于 2012-1-9 21:16:02

回复 4# 的帖子

我删掉conf文件,再重新建站,还是那样,郁闷噢
不知道会不会影响seo
我自己到是可以访问,就是测试全是301

红星 发表于 2012-1-10 18:42:19

回复 5# 的帖子

你用的 DZX吗 ,DZX后台要设置 默认域名,否则默认情况下 首页会 301

weizi1999 发表于 2012-1-13 14:15:08

DZX自带301的,不用设置的

imshu 发表于 2012-1-13 19:27:16

楼主是不是把网站目录放在WWWROOT下,你放在WWWROOT的平级目录试试,我的也是这样,不管配置是什么都301,但是方在WWROOT平级目录下的就没有这样的情况
页: [1]
查看完整版本: lnmp无论我那种方式设置conf文件,用工具检测http状态都是301