为了集中权重,把 178chajian.com 和 www.178chajian.com 合并到一个server上去,使用301永久重定向。 然后将 https://178chajian.com转到 https://www.178chajian.com 去。不过要在配置文件的 server https://www.178chajian.com 上配置 default_server ssl;。 301永久重定向,这样可以把搜索引擎的权重全部集中到https://www.178chajian.com上。
server
{
listen 80;
#listen [::]:80;
server_name www.178chajian.com 178chajian.com;
return 301 https://$host$request_uri;
index index.html index.htm index.php default.html default.htm default.php;
root /home/www/xxxx;
include rewrite/wordpress.conf;
#error_page 404 /404.html;
# 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 ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/xxx.log;
}
浙公网安备 33010602011771号