Redirecting from multiple domains to one domain.

darko1x

Power Member
Joined
Apr 7, 2015
Messages
590
Reaction score
224
Hey guys, A family member is trying to go with a new branding in his school business which is working good (apparently). He has two old websites that he used over the past years (the third and newer one is the branded domain), they have different offers but still in the same business (basically like a category that he can use in the new website).

So the thing is, the two websites are getting good traffic and ranking well in the SERP, the new website is getting traffic but not as much. (see the screen shot: HERE)

So what is the optimal approach to do this? 301 redirect every URL in .htaccess to a new/relevant URL in the new website? any example on how to do it?
 
As you previously said: 301 redirect every URL in .htaccess to a new/relevant URL in the new website
That's the right stuff how to use 301 redirect
 
what is the cleanest way to do it? let's say I wanna redirect this : old-website1.example/cat1/page1 to new-website.example/cat1/page1 .
I found this on stackoverflow and I don't get the answer.



should I add this in the old websites? how can this redirect every page on the old websites to the new one ?
Read a bit to understand how it works
There are many ways to redirect old to new websites
whether it is on the website level, PHP level or even javascript etc
They are all fundamentally the same method, some would argue one way is better than others but that's up for debate really

https://www.domain.com/help/article/how-to-create-a-301-redirect
 
After some research, I believe the cleanest method is to use the following script in .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
</IfModule>

with this, I redirected everything to the same url in the new website.
 
Back
Top