title: Redirect All Subdomain URLs to Home Page
body: <p>The website in question had a sub domain for the eCommerce platform, but now we've added the eCommerce functionality to the main site, so now we want to entire shop sub domain to redirect to the home page. Currently I'm using the following code in the .htaccess file:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^shop.domain.co.za$ [NC]
  RewriteRule ^(.*)$ http://www.domain.co.za%{REQUEST_URI} [R=301,NC,L,QSA]
  </code></pre>
  
  <p>This redirects any URL on the sub domain to that same URL on the main site, so <strong>shop.domain.co.za/product</strong> will redirect to <strong>www.domain.co.za/product</strong>, but we want it to redirect to home page, since the URL structure has completely changed.</p>
  
  <p>So in other words, we want any URL on <strong>shop.domain.co.za</strong> to rediect to the home page, <strong>www.domain.co.za</strong>, how can this be done?</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Thanks<br>
  Willem</p>