sofeng 发表于 2015-2-2 11:58:42

301重定向奇怪的问题,求教1

301重定向奇怪的问题,求教我把网站的所有301的回答看了试了,没有解决问题,这里求教一下。
一、
如图:

我用,判断的方法不行,用不带www打开后,出现
414 Request-URI Too Large 也就是域名无限循环。


二、采用http://lnmp.org/faq/lnmp-nginx-301-rewrite.html的方法

如图

同样出现上面的问题,域名无限循环, 是怎么回事?
我是哪里错了??server
      {
                listen       80;
                server_name www.xxx.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root/home/wwwroot/www.xxx.com;

                include none.conf;
                location ~ .*\.(php|php5)?$
                        {
                              try_files $uri =404;
                              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;
      return 301 $scheme://www.xxx.com$request_uri;
      }

[ 本帖最后由 sofeng 于 2015-2-2 12:02 编辑 ]

sofeng 发表于 2015-2-2 14:28:16

重启了一下,貌似又可以了。我再观察观察。
页: [1]
查看完整版本: 301重定向奇怪的问题,求教1