Skip to main content
Code formatting
Source Link
MrWhite
  • 43.1k
  • 4
  • 50
  • 90

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.htaccess file? (Presumably the .htaccess.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.

    ``RedirectRedirect 301 / http://www.newdomain.com/`

    ``OptionsOptions +FollowSymLinks`
+FollowSymLinks
    ``RewriteEngineRewriteEngine on`
on
    ``RewriteRuleRewriteRule (.*) http://www.newdomain.com/$1 [R=301,L`L]

    ``OptionsOptions +FollowSymLinks`
+FollowSymLinks
    ``RewriteEngineRewriteEngine on`
on
    ``RewriteCondRewriteCond %{HTTP_HOST} \olddomain.com$`
com$
    ``RewriteRuleRewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]`L]

    `OptionsOptions +FollowSymlinks`
+FollowSymlinks
    ``RewriteEngineRewriteEngine On`On

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

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

    ``RewriteEngineRewriteEngine on`
on
    ``RewriteCondRewriteCond %{HTTP_HOST} !^www.your_domain.com$`
com$
    ``RewriteRuleRewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]`[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 otherothers who come after me understand not just how to copy and paste a redirect but the particulars as well.

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/`

    ``Options +FollowSymLinks`

    ``RewriteEngine on`

    ``RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L`

    ``Options +FollowSymLinks`

    ``RewriteEngine on`

    ``RewriteCond %{HTTP_HOST} \olddomain.com$`

    ``RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]`

    `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]`

    ``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 other who come after me understand not just how to copy and paste a redirect but the particulars as well.

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/

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

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

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]

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.

I had to redo the post due to possible opinion as it was put on hold.
Source Link

This is likely a very simple question with a very simple solution. I am just unable to find it it would seem. I have searched many different sites and they all have different answers. This site also has many answers that will work to redirect one domain to another but does not really answer anything more than that. No explanations, No hows and whys it works, why its the best, nothing. This does not answer the question though of which method is best. And I think this is something important that has been overlooked. At least for me.

I have been trying to learn Apache code. How to write Apache directives in .htaccess but still do not know how to write my own.

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

This is likely a very simple question with a very simple solution. I am just unable to find it it would seem. I have searched many different sites and they all have different answers. This site also has many answers that will work to redirect one domain to another but does not really answer anything more than that. No explanations, No hows and whys it works, why its the best, nothing. This does not answer the question though of which method is best. And I think this is something important that has been overlooked. At least for me.

I have been trying to learn Apache code. How to write Apache directives in .htaccess but still do not know how to write my own.

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

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

Post Closed as "Opinion-based" by dan
Removed superfluous text from title, and question.
Source Link
dan
  • 15.2k
  • 11
  • 45
  • 52

Greetings fellow webmasters!

This is likely a very simple question with a very simple solution. I am just unable to find it it would seem. I have searched many different sites and they all have different answers. This site also has many answers that will work to redirect one domain to another but does not really answer anything more than that. No explanations, No hows and whys it works, why its the best, nothing. This does not answer the question though of which method is best. And I think this is something important that has been overlooked. At least for me.

I have been trying to learn apacheApache code. How to write apacheApache directives in .htaccess but still do not know how to write my own.

  • 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 apacheApache directives know which is the best one to use? It can't be as cut and dry as "Just use any that works".

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 apacheApache directive so that myself, and other who come after me understand not just how to copy and paste a redirect but the particulars as well. Thank you so much and I really hope I can get a clear answer this time with out getting down voted to webmaster hell. lol = )

I look forward to your reply! Thanks again!

Regards, Daniel M

Greetings fellow webmasters!

This is likely a very simple question with a very simple solution. I am just unable to find it it would seem. I have searched many different sites and they all have different answers. This site also has many answers that will work to redirect one domain to another but does not really answer anything more than that. No explanations, No hows and whys it works, why its the best, nothing. This does not answer the question though of which method is best. And I think this is something important that has been overlooked. At least for me.

I have been trying to learn apache code. How to write apache directives in .htaccess but still do not know how to write my own.

  • 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".

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 other who come after me understand not just how to copy and paste a redirect but the particulars as well. Thank you so much and I really hope I can get a clear answer this time with out getting down voted to webmaster hell. lol = )

I look forward to your reply! Thanks again!

Regards, Daniel M

This is likely a very simple question with a very simple solution. I am just unable to find it it would seem. I have searched many different sites and they all have different answers. This site also has many answers that will work to redirect one domain to another but does not really answer anything more than that. No explanations, No hows and whys it works, why its the best, nothing. This does not answer the question though of which method is best. And I think this is something important that has been overlooked. At least for me.

I have been trying to learn Apache code. How to write Apache directives in .htaccess but still do not know how to write my own.

  • 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".

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 other who come after me understand not just how to copy and paste a redirect but the particulars as well.

Loading
Source Link
Loading