title: Subdomain 301 redirect (htaccess)
body: <p>How could I redirect my subdomain to main domain name? For example, I would like to redirect media.www.example.com to www.example.com using htaccess 301 redirect.</p>
  
  <p>Tried this, but it's not working:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{HTTP_HOST} ^media.www.example.com$
  RewriteRule ^(.*)$ http://www.example.com/ [R=301,L]
  </code></pre>