title: htaccess redirecting www to non www is relentlessly bringing cached copy from google?
body: <p>I have a non www setup for a domain <strong>X.com.bd</strong> . when typed <strong>www.X.com.bd</strong> it gives a <strong>net::ERR_NAME_NOT_RESOLVED</strong> error and brings cached copy  suggestion page from google. I've written an .htaccess rule as </p>
  
  <pre><code>   RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
     RewriteRule ^(.*)$  http://%1/$1 [R=301,L]
  </code></pre>
  
  <p>And here is my whole .htaccess snippet :</p>
  
  <pre><code>  &lt;IfModule mod_rewrite.c&gt;
     # Turn on URL rewriting
     RewriteEngine On
     RewriteBase /
  
     RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
     RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
  
     # Protect application and system files from being viewed when the index.php is missing
     RewriteCond $1 ^(application|system|private|logs)
  
     # Rewrite to index.php/access_denied/URL
     RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
  
     # Allow these directories and files to be displayed directly:
     RewriteCond $1  ^(index\.php|robots\.txt|favicon\.ico|public|assets|resources|css|js|images|_assets|img)
  
    # No rewriting
     RewriteRule ^(.*)$ - [PT,L]
  
    # Rewrite to index.php/URL
    RewriteRule ^(.*)$ index.php/$1 [PT,L] 
  
    &lt;/IfModule&gt; 
  </code></pre>
  
  <p>Now all I need is to redirect www.X.com.bd to X.com.bd</p>
  
  <p>Any help is appreciated and thanks in advance.</p>