http-redirecthttp-status-code-301

301 Redirect to assimilate one website into another


I have a main website example.com and another website subsidary.com. The subsidary.com website is to be phased out and redirects put in place.

subsidary.com will have its A record repointed to example.com and a domain added in cPanel for example.com

Most of the entries in htaccess are straightforward, of the form

Redirect 301 /old-page-1 https://example.com/new-page-1
Redirect 301 /old-page-2 https://example.com/new-page-2
Redirect 301 /old-page-3 https://example.com/new-page-1
...

where old-page-1, 2 and 3 do not exist as URLs on the new site

So far, so good. My problem is that I need to direct the home page of the old site to a specific page on the new site.

Obviously I can't do

Redirect 301 / https://example.com/new-landing-page-subsidary-com

How do I target the old URL so that someone requesting https://subsidary.com is correctly redirected to https://example.com/new-landing-page-subsidary-com


Solution

  • With the help of the hosting support.

    1. Add a domain in Cpanel for the incoming domain pointing to its own directory
    2. Make an htaccess within that directory with the redirects
    3. IMPORTANT, ensure that the redirect for the main domain is only made once.