【问题标题】:apache2 handle subdomains and SSLapache2 处理子域和 SSL
【发布时间】:2016-11-05 05:26:40
【问题描述】:

我的 mycooldomain.com.conf (apache2) 中有这一行

  Redirect permanent / https://mycooldomain.com

它重定向到 https。 我想要做的是将子域重定向到 http,而所有域请求都通过 https 例如: mycooldomain.com/help 将重定向到https://mycooldomain.com 而 user.mycooldomain.com/blah 将重定向到 http://user.mycooldomain.com 现在子域也被发送到 https

【问题讨论】:

    标签: apache redirect ssl https subdomain


    【解决方案1】:

    添加重写规则:

    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} user.mycooldomain.com
    RewriteRule ^(.*)$ http://user.mycooldomain.com/$1 [QSA, R=301, L]
    
    Redirect permanent / https://mycooldomain.com
    

    【讨论】:

      猜你喜欢
      • 2022-07-22
      • 2016-12-08
      • 2021-05-27
      • 2021-01-24
      • 2010-09-18
      • 1970-01-01
      • 2017-08-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多