【发布时间】:2018-10-22 22:26:28
【问题描述】:
我想将所有通配符子域重定向到 https 并制定这样的重写规则:
http://#.example.com => https://#.example.com => https://example.com/index.php?id=#
我有这段代码,但它不起作用,我不确定语法。
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{HTTP_HOST} ^(.{2,})\.example.com$
RewriteRule (.*) https://example.com/index.php?id=%1 [P,L]
【问题讨论】:
-
用户页面:
http://#.example.com => https://#.example.com服务器:https://#.example.com like https://example.com/index.php?id=#
标签: php .htaccess ssl mod-rewrite