VPS侦探论坛

 找回密码
 注册
查看: 8817|回复: 3

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

[复制链接]
发表于 2011-6-20 14:17:04 | 显示全部楼层 |阅读模式

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_pass  unix:/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怎么写法啊?,试了好多方法,行不通
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-6-20 14:27:08 | 显示全部楼层


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

多域名server_name里,空格分开
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 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_pass  unix:/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;
}
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-6-20 14:45:01 | 显示全部楼层



应该是这样写的
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-20 19:30 , Processed in 0.026538 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表