回2楼服务器之家的帖子
请问用的帝国程序,怎么做301重定向。
我网上查找过,说是修改这个文件—     /alidata/server/nginx-1.2.5/conf   
打开这个文件是这样的:
-----------------------------------------
server {
        listen       80;
        server_name  localhost;
    index index.html index.htm index.php;
    root /alidata/www/phpwind;
    location ~ .*\.(php|php5)?$
    {
        #fastcgi_pass  unix:/tmp/php-cgi.sock;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires 30d;
    }
    location ~ .*\.(js|css)?$
    {
        expires 1h;
    }
    
    #伪静态规则
    include /alidata/server/nginx/conf/rewrite/phpwind.conf; 
    access_log  /alidata/log/nginx/access/phpwind.log;
}
--------------------------------------------------------
在论坛问过,说是加上这段代码:
-----------------------------------------------------
server {
  server_name www.domain.com;
  return 301 $scheme://domain.com$request_uri;
}
server {
  server_name domain.com;
  [...]
}
我想问问如果是正确的,那么代码加在哪个位置。
还有这个文件是做什么的,是不是不同的程序改的文件不同啊,我网上找方法时,有的说是改这个文件—/alidata/server/nginx-1.2.5/conf/vhosts
里面代码如下:
server {
        listen       80;
        server_name  localhost;
    index index.html index.htm index.php;
    root /alidata/www/phpwind;
    location ~ .*\.(php|php5)?$
    {
        #fastcgi_pass  unix:/tmp/php-cgi.sock;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires 30d;
    }
    location ~ .*\.(js|css)?$
    {
        expires 1h;
    }
    
    #伪静态规则
    include /alidata/server/nginx/conf/rewrite/phpwind.conf; 
    access_log  /alidata/log/nginx/access/phpwind.log;
}
------------------------------------------------------
最后问一个问题就是,nginx 里   404页面是怎么设置的,哪里改啊。
-------------------------
 回2楼服务器之家的帖子
请问用的帝国程序,怎么做301重定向。
 
 
我网上查找过,说是修改这个文件—     /alidata/server/nginx-1.2.5/conf   
 
 
打开这个文件是这样的:
-----------------------------------------
 
server {
        listen       80;
        server_name  localhost;
        index index.html index.htm index.php;
        root /alidata/www/phpwind;
        location ~ .*\.(php|php5)?$
        {
                #fastcgi_pass  unix:/tmp/php-cgi.sock;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi.conf;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                expires 30d;
        }
        location ~ .*\.(js|css)?$
        {
                expires 1h;
        }
        
        #伪静态规则
        include /alidata/server/nginx/conf/rewrite/phpwind.conf; 
        access_log  /alidata/log/nginx/access/phpwind.log;
}
 
 
--------------------------------------------------------
 
 
在论坛问过,说是加上这段代码:
-----------------------------------------------------
 
server {
  server_name www.domain.com;
  return 301 $scheme://domain.com$request_uri;
}
server {
  server_name domain.com;
  [...]
}
我想问问如果是正确的,那么代码加在哪个位置。
还有这个文件是做什么的,是不是不同的程序改的文件不同啊,我网上找方法时,有的说是改这个文件—/alidata/server/nginx-1.2.5/conf/vhosts
里面代码如下:
 
 
 
server {
        listen       80;
        server_name  localhost;
        index index.html index.htm index.php;
        root /alidata/www/phpwind;
        location ~ .*\.(php|php5)?$
        {
                #fastcgi_pass  unix:/tmp/php-cgi.sock;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi.conf;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                expires 30d;
        }
        location ~ .*\.(js|css)?$
        {
                expires 1h;
        }
        
        #伪静态规则
        include /alidata/server/nginx/conf/rewrite/phpwind.conf; 
        access_log  /alidata/log/nginx/access/phpwind.log;
}
------------------------------------------------------
 
 
最后问一个问题就是,nginx 里   404页面是怎么设置的,哪里改啊。