多个域名指向一个域名的纠结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怎么写法啊?,试了好多方法,行不通 https://bbs.vpser.net/viewthread.php?tid=2117
多域名server_name里,空格分开 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;
} 应该是这样写的
页:
[1]