title: Mod_Rewrite Force HTTP On All Files Except One
body: <p>Sorry if this has been asked before, but I couldn't find it.
  I have a folder which when I visit loads in both HTTPS and HTTP.</p>
  
  <p>I want all the files in that folder to load in HTTP except for one file.
  The file I need in in HTTPS is: login.php and this folder is called "forum".
  Also if it helps: All the files in the folder are *.php.</p>
  
  <p>I was trying something along the lines of:</p>
  
  <pre><code>#RewriteCond %{SERVER_PORT} !^443$
  #RewriteRule ^/login.php$ - [L]
  
  #RewriteCond %{SERVER_PORT} ^443$
  #RewriteRule ^(/login.php) $ https://%{HTTP_HOST}/$1 [QSA,NC,R,L]
  
  #RewriteCond %{SERVER_PORT} !^443$
  #RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [QSA,NC,R,L]
  </code></pre>
  
  <p>I'm a bit of an amateur when it comes to mod_rewrite so forgive me if the above is completely off.
  Also if you post a solution I would appreciate it if you post it with an explanation so I can actually LEARN how it works.</p>
  
  <p>Thanks in advance!
  David</p>