0

I would like to force users to use https to connect to my server, however I have a certain group of users who for historical reasons cannot use https. Luckily these users will all come from the same IP address.

Is it possible to force https, except if they come from a certain IP or IP range?

1 Answers1

2

Not sure why the down vote?? However I found the answer:

RewriteCond %{HTTPS} !=on
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

https://stackoverflow.com/questions/17812267/htaccess-force-ssl-for-all-ips-except-127-0-0-1#answer-17812453

  • That said, +1 from me for bothering to come back and document your research results! Please remember to accept your answer once the site permits it. – MadHatter May 28 '15 at 07:42