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;
} 第一种不会301,第二种会301
你测试/usr/local/nginx/sbin/nginx -t测试看看
回复 2# 的帖子
军哥,按道理来说,第一种应该是两个都不是301;第二种应该只有一个网站是301,对吧?现在我的情况是,无论用那一种,都是两个网站都是301所以才觉得见鬼了
我测试/usr/local/nginx/sbin/nginx -t了,提示是successfully
回复 3# 的帖子
的确怪诡异回复 4# 的帖子
我删掉conf文件,再重新建站,还是那样,郁闷噢不知道会不会影响seo
我自己到是可以访问,就是测试全是301
回复 5# 的帖子
你用的 DZX吗 ,DZX后台要设置 默认域名,否则默认情况下 首页会 301 DZX自带301的,不用设置的 楼主是不是把网站目录放在WWWROOT下,你放在WWWROOT的平级目录试试,我的也是这样,不管配置是什么都301,但是方在WWROOT平级目录下的就没有这样的情况
页:
[1]