I am forcing HTTPS on my small site using mod_rewrite but I wish to change this to HTTP for just about any URL using the substring com_bookmangement within the URL.

So

http://www.example.com/index.php?option=com_content&view=article&id=85&Itemid=140

is going to be forwarded to

https://www.example.com/index.php??option=com_content&view=article&id=85&Itemid=140

BUT

https://www.example.com/index.php?option=com_bookmanagement&controller=localbooks&Itemid=216

is going to be forwarded to

http://www.example.com/index.php?option=com_bookmanagement&controller=localbooks&Itemid=216

I have attempted this with no success:

#rewrite everything apart from com_bookmanagement to HTTPS
RewriteCond %{SERVER_PORT} !443
RewriteCond %{REQUEST_URI} !com_bookmanagement=
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

#rewrite vouchers views to http
#RewriteCond %{server_port} 443
RewriteCond %{REQUEST_URI} ^com_bookmanagement=
RewriteRule ^/(.*)$ http://www.example.com/$1 [R=301,L]

Any ideas?

If you are using ^com_bookmanagement= it'll only match if com_bookmanagement= seems at the beginning of the string. Check it out with no ^ and =. Or things i would use:

#rewrite everything apart from com_bookmanagement to HTTPS
RewriteCond %{HTTPS} !=on
RewriteCond %{QUERY_STRING} !(^|&)option=com_bookmanagement(&|$)
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

#rewrite vouchers views to http
RewriteCond %{HTTPS} !=off
RewriteCond %{QUERY_STRING} (^|&)option=com_bookmanagement(&|$)
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Condition on QUERY_STRING rather than REQUEST_URI:

RewriteCond %{SERVER_PORT} !443
RewriteCond %{QUERY_STRING} !com_bookmanagement
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L]
RewriteCond %{QUERY_STRING} com_bookmanagement
RewriteRule ^/(.*)$ http://www.mysite.com/$1 [R=301,L]

More about spinning URIs with query strings here.