我使用以下代码将我的子域的所有http请求重定向到https.
<VirtualHost *:80>
ServerName subdomain.example.com
Redirect 302 / https://subdomain.example.com
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
现在我的问题是如何为所有子域做到这一点.
例如,http:subdomain1.example.com应转到https:subdomain1.example.com,http:subdomain2.example.com应转到https:subdomain2.example.com
如何为所有子域执行此操作,而无需为所有子域创建一个虚拟主机
更新
我发现RedirectMatch采用正则表达式.有谁知道如何使用正则表达式?