VPS侦探论坛
标题:
求助军哥,多域名配置问题
[打印本页]
作者:
浅夏的黑夜
时间:
2018-8-2 10:32
标题:
求助军哥,多域名配置问题
部署网站时,用的是一个二级域名的,uu.yyyyy.cn vhost下的配置文件是uu.yyyyy.cn.conf 现在我想绑定三个域名,www.aaa.com www.aaa.cn www.aaa.net但是只有访问www.aaa.cn 和uu.yyyyy.cn才能访问得了网站 www.aaa.com 和 www.aaa.net都跳转至https://uu.yyyyy.cn而访问不了, 后面这三个域名都备案过了的,
server
{
listen 80;
#listen [::]:80;
server_name www.aaa.com www.aaa.cn www.aaa.net uu.yyyyy.cn;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/uu;
include other.conf;
#error_page 404 /404.html;
#rewrite ^/(.*) https://$server_name/$1 permanent;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location / {
index index.php index.html index.htm;
#如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
if (!-e $request_filename)
{
#地址作为将参数rewrite到index.php上。
rewrite ^/(.*)$ /index.php?s=$1;
#若是子目录则使用下面这句,将subdir改成目录名称即可。
#rewrite ^/subdir/(.*)$ /subdir/index.php?s=$1;
}
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/uu.yyyyy.cn.log;
}
复制代码
作者:
licess
时间:
2018-8-2 12:33
仅按上面贴出的配置看没有启用301的设置
如果没有其他相关配置,有可能程序上有相关的设置
作者:
浅夏的黑夜
时间:
2018-8-2 14:05
标题:
回复 2# 的帖子
没有其他的配置了,如何启用301设置呢,
作者:
licess
时间:
2018-8-2 20:06
return 301
permanent 之类的都是设置301的
欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/)
Powered by Discuz! X3.4