如何将example.comfrom的所有子域重定向http到httpsusing .htaccess?
我已经搜索过Google,但是找不到解决方案。
要将的所有子域重定向example.com到https,可以使用:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.example\.com$
RewriteRule ^ https://%1.example.com%{REQUEST_URI} [NE,L,R]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3095 次 |
| 最近记录: |