title: htaccess script for Wordpress to serve selected page as https
body: <p>I have two pages on my Wordpress site that need to be served as https; the rest is vanilla http. Pushing the whole site to https would involve a lot of database editing to avoid mixed content, so I'm looking to write an htaccess script to use a RewriteRule that will make the change just for those two pages. </p>
  
  <p>The browser addresses for the two pages are like
  <a href="http://example.com/draw/membership-login/" rel="nofollow noreferrer">http://example.com/draw/membership-login/</a> and 
  <a href="http://example.com/draw/membership-join/membership-registration/" rel="nofollow noreferrer">http://example.com/draw/membership-join/membership-registration/</a> 
  Note they both contain the word 'membership' and no other page does (or so I believe), so I thought I'd write a rule to look for any REQUEST_URI containing 'membership'. I did this and put it before Wordpress's own script in .htaccess (.htaccess is in directory draw, the home directory for the Wordpress installation). It looks like this (only the first 4 lines are mine; the rest is WordPress's, except I've commented out their RewriteEngine On).</p>
  
  <pre><code>RewriteEngine On  
  RewriteCond %{HTTPS} off  
  RewriteCond %{REQUEST_URI} membership
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=302, L]  
  # BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  #RewriteEngine On
  RewriteBase /draw/
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /draw/index.php [L]
  &lt;/IfModule&gt;
  # END WordPress
  </code></pre>
  
  <p>Result? All pages serve ok except the two membership pages, which serve as 404.</p>
  
  <p>I guess it's good news in a sense, as the RewriteCond must be finding the membership pages, but the RewriteRule is clearly not delivering what I had hoped.</p>
  
  <p>Any help much appreciated. </p>