VPS侦探论坛

 找回密码
 注册
查看: 3043|回复: 2

请问一个主机2个域名怎么写301重定向

[复制链接]
发表于 2019-2-27 14:11:04 | 显示全部楼层 |阅读模式

nginx上配置一个server上2个域名 分别为 lnmp.org www.lump.org        listen 80;
        #listen [::]:80;
        server_name lnmp.org www.lnmp.org;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/typecho;

想加一段301重定向要求


lnmp.org > https://www.lnmp.org
www.lnmp.org > https://www.lnmp.org
lnmp.org/*所有子页面 > https://www.lnmp.org/*所有子页面
www.lnmp.org/*所有子页面 > https://www.lnmp.org/*所有子页面

目前我能测试成功的办法只有吧lnmp.org和www.lnmp.org建2个站点才行..有办法在这一个站点conf里解决么
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2019-2-27 15:29:24 | 显示全部楼层


自己已解决...
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2019-2-27 16:03:31 | 显示全部楼层

lnmp官网 https://lnmp.org 上有301教程,自行搜索301
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-23 03:28 , Processed in 0.025471 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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