800y 发表于 2010-12-30 22:06:56

关于301的问题

主机不加IP的时候用;
server {
server_name 114466.cn;
rewrite ^(.*) http://www.114466.cn$1 permanent;
}

定向成功,加了IP就不起作用了,请问是什么问题?

server
{
listen       184.82.6.22:80;
server_name www.114466.cn;

licess 发表于 2010-12-31 10:07:49

回复 1# 的帖子

改成listen 80;

800y 发表于 2010-12-31 18:05:19

老大还是不行,也重启过了

server
      {
                listen       184.82.6.35 80;
                server_name www.cu25.info;
                index index.html index.htm index.php default.html default.htm default.php;
                root/home/wwwroot/www.cu25.info;

                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 cu25.info;
rewrite ^(.*) http://www.cu25.info$1 permanent;
}

800y 发表于 2011-1-1 14:39:10

麻烦军哥看看!!!!

800y 发表于 2011-1-3 10:57:56

军哥一直没有解决,麻烦看看!

licess 发表于 2011-1-3 13:10:00

回复 5# 的帖子

server {
listen 80;
server_name cu25.info;
rewrite ^(.*) http://www.cu25.info$1 permanent;
}


再 /usr/local/nginx/sbin/nginx -t 看一下

800y 发表于 2011-1-4 14:16:33

the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful

老大,是这个提示

listen 80;
这里加上IP好像就OK了!
页: [1]
查看完整版本: 关于301的问题