title: .htaccess redirect all pages to new domain
body: <p>Which redirect rule would I use to redirect all pages under <code>olddomain.example</code> to be redirected to <code>newdomain.example</code>?</p>
  
  <p>The site has a totally different structure, so I want <strong>every page</strong> under the old domain to be redirected to the new domain <strong>index page</strong>.</p>
  
  <p>I thought this would do (under olddomain.example base directory):</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^(.*)$ http://newdomain.example/ [R=301]
  </code></pre>
  
  <p>But if I navigate to <code>olddomain.example/somepage</code> I get redirected to <code>newdomain.example/somepage</code>. I am expecting a redirect only to <code>newdomain.example</code> without the page suffix.</p>
  
  <p>How do I keep the last part out?</p>