I use apache 2.4 on centos.
I want to protect the access to a page (/my_folder/secure) with a cookie (in my exemple the cookie name is : my_cookie_name)
I would like that some machine with IP 192.1.1.10 and 192.1.1.11 can access the server without the cookie. This two IP address don't need to have the cookie for access to /my_folder/secure)
And all other IP address are redirect to address https://my_register_site.com
if they don't have the cookie.
How to write this ? Some example, and of course it does not work.
Session On
RewriteEngine on
RewriteCond %{HTTP_COOKIE} !my_cookie_name
RewriteCond %{REMOTE_ADDR} !^192.1.1.10$
RewriteCond %{REMOTE_ADDR} !^192.1.1.11$
RewriteRule ^(.*)$ https://my_register_site.com [NC,L,R=301]