1
我試圖做到這一點:Apache的mod_rewrite的:子域重定向到HTTPS登錄頁面
http://subdomain.server.com/
應該重定向到https://secure.server.com/login?subdomain
,但http://subdomain.server.com/any-other-page
應該通過原樣。
我可以在.htaccess
文件中完成此操作嗎?
我試圖做到這一點:Apache的mod_rewrite的:子域重定向到HTTPS登錄頁面
http://subdomain.server.com/
應該重定向到https://secure.server.com/login?subdomain
,但http://subdomain.server.com/any-other-page
應該通過原樣。
我可以在.htaccess
文件中完成此操作嗎?
試試這個規則:
RewriteCond %{HTTP_HOST} !=secure
RewriteCond %{HTTP_HOST} ^([^/.]+)\.example\.com$
RewriteRule ^$ https://secure.example.com/login?%1
RedirectMatch ^/?$ https://secure.server.com/login?subdomain