title: Creating a beta version of site on subdomain
body: <p>I have a website that I have been working on for a while. All this time I have been editing the live website files on the web server for my development. I finally realized that it was stupid to edit the live site. My "quick" solution is to copy everything from example.com to beta.example.com. I will edit the beta subdomain and when I have a feature to release, I will copy and replace the existing code on the example.com site. Great.</p>
  
  <p>That would be great if I could get it to work. I'm having troubles with my .htaccess files for both domains and URL rewriting.</p>
  
  <p>For my example.com site, I use a .htaccess like so: (there are only a handful of pages on my site)</p>
  
  <pre><code>RewriteEngine On
  
  RewriteCond %{HTTP_HOST} !^example.com$ [NC]
  RewriteRule ^(.*)$ http://example.com/$1 [R=301]
  
  RewriteCond %{REQUEST_URI} ^/recent
  RewriteRule ^ recent.php [NC,L]
  
  RewriteCond %{REQUEST_URI} ^/about
  RewriteRule ^ about.php [NC,L]
  
  RewriteCond %{REQUEST_URI} ^/category/(.*)/(.*)
  RewriteRule ^ category.php?id=%1&amp;name=%2 [NC,L]
  
  RewriteCond %{REQUEST_URI} ^/category/(.*)
  RewriteRule ^ category.php?id=%1 [NC,L]
  </code></pre>
  
  <p>The problem with the beta.example.com site is that it always redirects to just regular example.com. It removes the beta subdomain.</p>
  
  <p><strong>What is the proper .htaccess code to get subdomain sites separate from non-subdomains?</strong></p>