Let's say I have a website xxxx.com/ and I want to redirect any pages to https, except pages with /admin/, for example xxxx.com/admin/xxx.php will use http.
I tried to follow How to force rewrite to HTTPS except for a few pages in Apache?
and I came up with this
RewriteCond %{HTTPS} =off
RewriteCond %{REQUEST_URI} !^\/admin\/
RewriteRule (.*) https://%{HTTP_HOST}/$1 [L,R=301]
RewriteCond %{HTTPS} =on
RewriteCond %{REQUEST_URI} ^\/admin\/
RewriteRule (.*) http://%{HTTP_HOST}/$1 [L,R=301]
but this is not working, I typed xxxx.com/admin and it redirected to https://xxxx.com/cgi-bin/php55.cgi/admin/index.php
How do I solve this?