LNMP Nginx If you want to redirect domain name 111cn.net 301 to Www.111cn.net, and Www.111cn.net has been added through Lnmp vhost Add,
You can modify the following steps.
Edit the corresponding virtual host configuration file, the general virtual host configuration file is located in:/usr/local/nginx/conf/vhost/domain name. conf, such as the added domain name is www.111cn.net
The configuration file is/usr/local/nginx/conf/vhost/www.111cn.net.conf with the following code at the back of the configuration file:
Omitting www.111cn.net virtual Host server configuration
server {
Listen 80;
server_name 111cn.net;
return to Http://www.111cn.net$request_uri;
}
If you want more domain names redirect to www.111cn.net, just add more domain names after server_name, and separate them with spaces.
Zfsphp.cn,www.zfsphp.cn is redirected to Www.111cn.net as follows
server {
Listen 80;
server_name 111cn.net zfsphp.cn www.zfsphp.cn;
return to Http://www.111cn.net$request_uri;
}