 <p>I agree with Gumbo, but here's how you can do it:</p> <blockquote> <p>1.. Get the rewriterule to work in httpd.conf</p> </blockquote> <p>As is clearly stated in the <a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#vhosts" rel="nofollow noreferrer">manual</a>:</p> <blockquote> <p>By default, mod_rewrite configuration settings from the main server context are not inherited by virtual hosts. To make the main server settings apply to virtual hosts, you must place the following directives in each section:</p> <pre><code>RewriteEngine On RewriteOptions Inherit </code></pre> </blockquote> <p>&nbsp;</p> <blockquote> <p>2.. Detect if HTTPS is on, and if it is and the is is a secure page, rewrite to ...</p> </blockquote> <p>This can be done by looking at %{HTTP_HOST}:</p> <pre><code>RewriteCond %{HTTPS} !=on RewriteRule /jquery\.min\.js$ https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js [NC,R=permanent] RewriteCond %{HTTPS} =on RewriteRule /jquery\.min\.js$ http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js [NC,R=permanent] </code></pre> <p>You should also escape the dots and teh RewriteCond you use is unnecessary; you can do it in the RewriteRule.</p> <blockquote> <p>3.. Each individual domain will still have it's own custom mod-rewrite rules. Which rules take precedence - global or per-domain? Do they combine? Is it ok if I have the "RewriteEngine On" directive in the global httpd.conf and then again in the vhost.conf?</p> </blockquote> <p>It will be prepended to the virtual host's mod_rewrite configuration.</p>