1

There are a few questions that are inherently present inside the main question. Those questions are:

  • What is the best way to perform this type of redirect? (Presumably a 301 Perma for SEO Best practices. You will retain 90%-99% of your link juice.)
  • At what level would you perform the redirect? Would you do it at the registrar level, in the cPanel/direct admin/etc, or would you perform this task in the .htaccess file? (Presumably the .htaccess file)
  • There are so many ways you can redirect from one domain to another how do we webmasters who can't read Apache directives know which is the best one to use? It can't be as cut and dry as "Just use any that works".

As there are multiple ways to accomplish this task, the task of redirecting one domain to another, the PRIMARY CONCERN of this question is what is the BEST WAY to accomplish this task, perform a redirect, and do it properly Below are a few of the examples I have seen (on this site and other sites):

1.

Redirect 301 / http://www.newdomain.com/

2.

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

3.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} \olddomain.com$
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]

4.

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]

5.

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.your_domain.com$
RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]

Your assistance in this matter is priceless I have been trying to get a straight answer to this question for months. Even other people I see ask this question or questions similar receive the same answer even though our problems are sightly different or largely different. If you can, when you answer this, please explain to me why the redirect method you choose to answer with is the best one, why it's the best, and how it works. Please break down the Apache directive so that myself, and others who come after me understand not just how to copy and paste a redirect but the particulars as well.

3
  • Unfortunately this is too broad and opinion-based: as noted, there are several ways to do redirection, depending on what you're trying to accomplish and how. The .htaccess code snippets you provided also do different things, so users would have to explain those differences... In general, questions asking for the "best ____" are considered opinion-based and don't fit well with our site's format, which is to answer single issue/problem based questions in a definitive way. I'd suggest editing this to focus on what you're trying to accomplish so users can try to answer that specifically.
    – dan
    Commented Jan 17, 2017 at 0:55
  • In order to determine "the best way" you need to be more specific. For instance, are olddomain.com and newdomain.com pointing to different servers? If not, then that rules out "the best way".
    – MrWhite
    Commented Jan 17, 2017 at 2:04
  • Ok thanks you both @dan and w3dk. I will re-ask the question. first I will need to ask a new question. while this one is on hold, as this one may not be the right question I needed to ask. On that other question I will be sure to be more specific. Commented Jan 17, 2017 at 20:25

0