SSL通配符Apache
我有一个SAAS,其中我需要动态创建多个子域(注意:有很多子域,我不知道哪些子域将自动生成)。所以我不能对每一个都重复这一点:SSL通配符Apache,apache,.htaccess,ssl,wildcard,Apache,.htaccess,Ssl,Wildcard,我有一个SAAS,其中我需要动态创建多个子域(注意:有很多子域,我不知道哪些子域将自动生成)。所以我不能对每一个都重复这一点: <VirtualHost *:80> ServerName a1.app.example.com Redirect / https://a1.app.example.com </VirtualHost> ServerName a1.app.example.com 重定向/https://a1.app.example.com
<VirtualHost *:80>
ServerName a1.app.example.com
Redirect / https://a1.app.example.com
</VirtualHost>
ServerName a1.app.example.com
重定向/https://a1.app.example.com
有没有办法将http中的每个子域重定向到https?。类似于“重定向/https://*.app.example.com”
ServerName app.example.com
重定向/https://*.app.example.com
ServerName app.example.com
ServerAlias*.app.example.com
DirectoryIndex.php
DocumentRoot/var/www/xxxxxxx
斯伦金安
SSLCertificateFile/etc/ssl/xxxxx.crt
SSLCertificateKeyFile/etc/ssl/xxxx.key
SSLCertificateChainFile/etc/ssl/xxxx.crt
将其添加到主vhost中:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,QSA,R=301]
并确保
mod_rewrite
处于活动状态。您可以使用a2enmod rewrite
命令激活它。您没有对我提供的答案提供任何输入。温柔地提醒您提供一些反馈/投票/接受,如果有帮助:-)
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,QSA,R=301]