RewriteEngine on RewriteCond %{HTTPS} =on RewriteCond %{REQUEST_URI} ^/adm/wrapper/ext/(?!https:\/\/) RewriteCond %{QUERY_STRING} (^|&(|amp;))usehttp=1($|&) RewriteRule ^/adm/wrapper/ext/(?!https:\/\/) http://%{HTTP_HOST}%{REQUEST_URI} [R,L,NE] RewriteCond %{REMOTE_ADDR} 127.0.0.1 RewriteRule (.*) - [L] RewriteCond %{REMOTE_ADDR} {[[[[HostIP]]]]} RewriteRule (.*) - [L] RewriteCond %{REQUEST_URI} ^/public/.*/syllabus$ RewriteCond %{QUERY_STRING} (^|&(|amp;))usehttp=1($|&) RewriteRule ^/public/.*/syllabus$ http://%{HTTP_HOST}%{REQUEST_URI} [R,L,NE]