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