Я пытаюсь сделать это:
http://subdomain.server.com/ следует перенаправить на https://secure.server.com/login?subdomain, но http://subdomain.server.com/any-other-page должно пройти как есть.
http://subdomain.server.com/
https://secure.server.com/login?subdomain
http://subdomain.server.com/any-other-page
Могу ли я сделать это в файле .htaccess?
.htaccess
Попробуйте это правило:
RewriteCond %{HTTP_HOST} !=secure RewriteCond %{HTTP_HOST} ^([^/.]+)\.example\.com$ RewriteRule ^$ https://secure.example.com/login?%1
RedirectMatch ^/?$ https://secure.server.com/login?subdomain