VPS侦探论坛

 找回密码
 注册
查看: 4049|回复: 1

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

[复制链接]
发表于 2015-2-2 11:58:42 | 显示全部楼层 |阅读模式

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

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


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

如图

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

  7.                 include none.conf;
  8.                 location ~ .*\.(php|php5)?$
  9.                         {
  10.                                 try_files $uri =404;
  11.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  12.                                 fastcgi_index index.php;
  13.                                 include fcgi.conf;
  14.                         }

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

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

  23.                 access_log off;
  24.         }
  25.         server {
  26.         server_name xxx.com;
  27.         return 301 $scheme://www.xxx.com$request_uri;
  28.         }
复制代码

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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2015-2-2 14:28:16 | 显示全部楼层


重启了一下,貌似又可以了。我再观察观察。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-17 19:29 , Processed in 0.026417 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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