简体   繁体   English

apache2处理子域和SSL

[英]apache2 handle subdomains and SSL

I have this line in my mycooldomain.com.conf (apache2) 我的mycooldomain.com.conf(apache2)中有这一行

  Redirect permanent / https://mycooldomain.com

it redirects to https. 它重定向到https。 What I am trying to do is redirect subdomains to http while all domain requests go through https for example: mycooldomain.com/help will redirect to https://mycooldomain.com while user.mycooldomain.com/blah will redirect to http://user.mycooldomain.com right now subdomains are being sent to https as well 我想做的是将子域重定向到http,而所有域请求都通过https进行例如:mycooldomain.com/help将重定向到https://mycooldomain.com,而user.mycooldomain.com/blah将重定向到http:/ /user.mycooldomain.com现在子域也将发送到https

Add a rewrite rule: 添加重写规则:

RewriteEngine on

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

Redirect permanent / https://mycooldomain.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM