I would like to redirect to https using mod_rewrite only if certain conditions are met:
If the URL does NOT contain the word 'administrator' AND the URL DOES contain the string 'xyz' (in any part of the URL, including the querystring)
This does not seem to work:
RewriteCond %{REQUEST_URI} xyz [NC,OR]
RewriteCond %{QUERY_STRING} xyz [NC]
RewriteCond %{REQUEST_URI} !administrator [NC]
ReWriteCond %{HTTPS} != on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R,L]