How to do 301 Redirect?

utkarsh123

Newbie
Joined
Jul 27, 2017
Messages
27
Reaction score
2
let's suppose x,y,z. Where x.y.com is a old website and y.com is a subdomain, z.com is a new website.

So now,

I need this website x.y.com and its traffic and history transferred to this
z.com
At the least for this to be permanently on a redirect for the moment as this ranks higher than new WordPress site . Both old and new sites running and don't lose any ranking of these websites.

I need a redirection of traffic from this website "x.y.com" to z.com. If you put z.com into google it brings up the x.y.com site not the new branded site at z.com. I thought a 301 redirect would fix this ? Is there another way ?
 
I tried 301 redirection about 2 years ago, the redirected site was nowhere to be found on google while the new site getting the redirection jumped near to the initial position of old site.
 
you mean x.y.com is the subdomain and y.com is the old site?

I just get it done at the registrar's end in their dns section. You will need to use the ns of your registrar for it. You can redirect your subdomains too
 
Your example is a little confusing , should post with website.com subdomain.website.com to mkae it clear just using x,y,z leaves a lot of variations open.

Anyways htaccess 301

Just a page
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html

Whole domain
Redirect 301 / http://newsite.com/

Obviously place this in your old domain root .htaccess or here for a subdomain :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^sub.domain.com$ [NC]
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
</IfModule>
 
Back
Top