Hi,
When we create new sites for clients, we always add 301 redirects for their old pages so they don’t lose any SEO ‘juice’ or get errors. Sometimes we are using the same domain for the new site, sometimes it’s a new domain. When a new domain is used, we park their old domain on the cPanel account so we have access to it and can do redirects locally in our .htaccess file.
All sites are WordPress and hosted on our dedicate server running WHM/cPanel.
We typically add redirects using the following syntax to work with our WordPress sites when the domain is not changing:
1) What would be the proper syntax if we needed to redirect old pages from TWO different domains/sites to one new site, especially if there was a possibility they may have duplicate old page URLs?
We are combining 2 current sites using unique domains into 1 new ‘combined’ site using a new domain. Want to redirect the pages from their old sites (which ‘may’ have identical page URLs on occasion) to the proper new pages on the new site, which would be different for each. Both of the old domains will be parked on this new account with their registrars pointing properly, so we do have access to redirect these domains.
It depends on whether each domain will get its own virtual host or not. If each domain gets its own virtual host, and therefore each domain gets its own htaccess, then you can use Redirect. Or, if each domain – both old and new – are using the same virtual host, and therefore sharing the same htaccess, then your best bet is to use RewriteRule, because that lets you use RewriteCond to restrict the redirects to only certain domains.
These will be on a single virtual host (using the same cPanel account), so they both use the same root .htaccess file.
Can you give any examples of the proper syntax for me, though? I’m just not too familiar with the language, and the examples I’ve used before (see above) don’t ever specify the ‘old’ domain, just the new.
Hi,
We actually are going to do the redirects on the existing accounts for now since they are on the same server and we can’t park live domains on our new site until the existing ones are deleted.
But if we setup specific redirects for all/most of the subpages on the site, how do we get the root home page to redirect properly as well?
When I use ‘Redirect 301 / http://www.newab.com/’ it redirects all subpages to the same corresponding subpages on the new site, instead of using my specific redirects I’ve added.
How can we get both the home page AND different end subpages to redirect together properly?
Now, would I add this in addition to the standard ‘Redirect 301 /oldpage/ http://www.newAB.com/newpage’ lines that I currently have for all the subpages?
Or would I need to use RedirectMatch for all redirects (i.e., you can’t mix & match different methods)?