htaccess redirect all pages to single page

Viewed 115282

I want to redirect all of my old domain request to my new domain using htaccess file. Below is what I am using but it does not work if the page is not on the new site. For example google index about.htm on the old site but on the new site it does not exist. I would like it to just go to the root in all cases. I know this is not ideal for seo but I don't want any 404s. Any suggestions?

Redirect 301 / http://www.thenewdomain.com/
6 Answers

HTAccess to send all pages of a website to one page. This worked for me:

ErrorDocument 404 /page-name.php

or to a different domain...

RedirectMatch 301 ^/.*$ https://www.example-domain.com/page-name.php
Related