uckk 发表于 2011-6-20 14:17:04

多个域名指向一个域名的纠结301问题

server
{
listen       80;
server_name 421351.com www.421351.com qqape.com www.qqape.com text.hy150.com;
index index.html index.htm index.php;
root/home/wwwroot/421351.com;

include dede.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;
}



各位,这么多域名全指向www.421351.com怎么写法啊?,试了好多方法,行不通

licess 发表于 2011-6-20 14:27:08

https://bbs.vpser.net/viewthread.php?tid=2117

多域名server_name里,空格分开

uckk 发表于 2011-6-20 14:44:36

server
{
listen       80;
server_name www.421351.com;这里是这样写的吧.呵呵
index index.html index.htm index.php;
root/home/wwwroot/421351.com;

include dede.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 421351.com qqape.com www.qqape.com text.hy150.com;
    rewrite ^(.*) http://www.421351.com$1 permanent;
}

uckk 发表于 2011-6-20 14:45:01

应该是这样写的
页: [1]
查看完整版本: 多个域名指向一个域名的纠结301问题