i was migrating a server from http to https. while header-based redirect worked for most of the clients, for some – i had to allow for a transition period where some configuration / code had to be adjusted.
here’s the config that responds with 302 redir to most of the http requests, but for those coming from very specific hosts, still serves content via http:
<VirtualHost *:80> ServerName name.of.the.server [..] RewriteEngine On RewriteCond %{REMOTE_ADDR} !10.2.1.10 RewriteCond %{REMOTE_ADDR} !10.3.11.2 RewriteRule ^(.*)$ https://name.of.the.server/$1 [..] </VirtualHost>