title: .htaccess redirect with multiple rewrites
body: <p>I am trying to redirect a few select pages to HTTPS. I have found numerous examples but they do not seem to work with whats in my current htaccess file. My current htaccess has</p>
  
  <pre><code>RewriteEngine On
  Options +FollowSymLinks
  # Redirect all other domains to the primary
  RewriteCond %{HTTP_HOST} ^(www\.?|)(domain1\.com|domain2\.com|domain3\.com|\.co)$
  RewriteRule ^(.*)$ http://www.prefferreddomain.com/$1 [R=301,L]
  # Error Documents
  ErrorDocument 401 /errors/401.php
  ErrorDocument 403 /errors/403.php
  ErrorDocument 404 /errors/404.php
  #Cache Settings, etc. after this
  </code></pre>
  
  <p>I am doing this currently in my htaccess file for SEO as we own several domain names (20+). Anyway I want 3 pages to redirect to HTTPS but all the examples I have tried did not work as expected. I am not sure if I should put them before or after the redirect that is currently in the htaccess file.</p>
  
  <p>The pages that should be redirected to https are logon.php &amp; chat.php. So I tried</p>
  
  <pre><code>RewriteEngine On
  Options +FollowSymLinks
  
  RewriteCond %{HTTPS} off
  RewriteCond %{REQUEST_URI} (logon.php)
  RewriteRule (.*) https://www.preferreddomain.com%{REQUEST_URI} 
  
  RewriteCond %{HTTPS} off
  RewriteCond %{REQUEST_URI} (chats.php)
  RewriteRule (.*) https://www.preferreddomain.com%{REQUEST_URI}
  
  # Redirect all other domains to the primary
  RewriteCond %{HTTP_HOST} ^(www\.?|)(domain1\.com|domain2\.com|domain3\.com|\.co)$
  RewriteRule ^(.*)$ http://www.prefferreddomain.com/$1 [R=301,L]
  # Error Documents
  ErrorDocument 401 /errors/401.php
  ErrorDocument 403 /errors/403.php
  ErrorDocument 404 /errors/404.php
  #Cache Settings, etc. after this
  </code></pre>
  
  <p>But this did not work. Does anyone have any pointers.</p>