title: htaccess mod rewrite allow one domain without www and preserve one certain subdomain
body: <p>I´d like to point all possible entered domains to one certain base domain without www:</p>
  
  <p><em>www.example1.com<br>
  example2.net<br>
  example3.nl<br>
  etc.<br>
  ( countless different... getting more)</em><br></p>
  
  <p>rewritten to > </p>
  
  <p><em>base-example.com</em></p>
  
  <p>here is the hook – <br>
  There is a certain subdomain that should still be possible to be entered:</p>
  
  <p><em>subdom.base-example.de</em></p>
  
  <p>(that subdom. will be attached to a subfolder <strong>/data/stuff/different</strong>)</p>
  
  <p>but in the adress bar there will always be shown <strong>subdom.base-example.de</strong> ( no subfolder info visible )</p>
  
  <hr>
  
  <p>I tried:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^base-example\.com$ [OR]
  RewriteCond %{HTTP_HOST} ^subdom\.base-example\.com$ 
  RewriteRule ^data/stuff/different/(.*)$ http://subdom.example.com/$1 [R=301]
  RewriteRule ^data/stuff/(.*)$ http://subdom.example.com/$1 [R=301]
  RewriteRule ^data/(.*)$ http://subdom.example.com/$1 [R=301]
  
  
  RewriteCond %{HTTP_HOST} ^subdom\.base-example\.com$
  RewriteRule ^(.*)$ http://subdom.base-example.com/$1 [R=301]
  
  RewriteCond %{HTTP_HOST} !^base-example\.com$
  RewriteRule ^(.*)$ http://base-example.com/$1 [R=301]
  </code></pre>