Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2016
    Posts
    21
    Rep Power
    0

    301 re-direct on domain


    Hi,

    What is best for 301 re-direct?

    We have migrated to new domain. So on old domain do we:

    a) remove old site and upload a .htaccess with domain re-direct? - The URLs will be same on new site, except domain

    or

    b) Re-direct the domain itself?

    What is better? is (b) a 301 re-direct? or something better? or worse?
  2. #2
  3. No Profile Picture
    Contributing User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Oct 2016
    Posts
    3
    Rep Power
    0
    301 Redirects Rules Change, You need to read full article before using 301.
    https://moz.com/blog/301-redirection-rules-for-seo
  4. #3
  5. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2016
    Posts
    21
    Rep Power
    0
    Originally Posted by sajid26425
    301 Redirects Rules Change, You need to read full article before using 301.
    https://moz.com/blog/301-redirection-rules-for-seo
    Thanks for that, but what i am looking to find out is whether it is better to

    a) keep hosting, remove old website and re-direct using HTaccess file

    or

    b) remove hosting, remove old website and place a 'web forward' on the domain.

    Personally i would rather use point ' a' as that would allow adjustments on a specific page, which might be needed in future.

    Whereas 'web forward' on domain although clean and doesn't need us to keep a hosting server we are not going to be using, it is a bit more of a 'blanket approach' as it doesn't allow for more individual page adjustment later.
  6. #4
  7. No Profile Picture
    Contributing User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Oct 2016
    Posts
    3
    Rep Power
    0
    i suggest you too keep hosting and use url to url 301

    Comments on this post

    • KnowOneSpecial agrees
  8. #5
  9. No Profile Picture
    Contributing User
    SEO Chat Adventurer (500 - 999 posts)

    Join Date
    Sep 2016
    Posts
    896
    Rep Power
    2129
    Put this code in your htaccess file on your old domain, if you are using linux servers. Also install SSL on your new site. Its free and is a ranking signal for Google.

    This will redirect every url on the old domain to the same url on the new domain, if like you said the url structure is remaining the same.

    if you add ssl to the new site, as recommended, just add an "s" to http in the RewriteRrule. This will save you a rewrite on your new site.

    Use this for www preferred

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

    or this for non-www preferred

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.olddomain\.com [NC]
    RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
  10. #6
  11. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2016
    Posts
    21
    Rep Power
    0
    Originally Posted by KnowOneSpecial
    Put this code in your htaccess file on your old domain, if you are using linux servers. Also install SSL on your new site. Its free and is a ranking signal for Google.

    This will redirect every url on the old domain to the same url on the new domain, if like you said the url structure is remaining the same.

    if you add ssl to the new site, as recommended, just add an "s" to http in the RewriteRrule. This will save you a rewrite on your new site.

    Use this for www preferred

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

    or this for non-www preferred

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.olddomain\.com [NC]
    RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
    Sorry for the delay in responding. Many thanks for that I will place in old hosting.

    One thing I wanted to add can I use the above and individual re-directs? As I have some 'author' pages that are not in existence in the new website.
  12. #7
  13. No Profile Picture
    Contributing User
    SEO Chat Adventurer (500 - 999 posts)

    Join Date
    Sep 2016
    Posts
    896
    Rep Power
    2129
    Yes , you can do individual rewrites for specific files as well....

    Not knowing exactly what you want.. here is the Apache Documentation...

    mod_rewrite - Apache HTTP Server Version 2.4
  14. #8
  15. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2016
    Posts
    21
    Rep Power
    0
    Originally Posted by KnowOneSpecial
    Yes , you can do individual rewrites for specific files as well....

    Not knowing exactly what you want.. here is the Apache Documentation...

    mod_rewrite - Apache HTTP Server Version 2.4
    What I want it to re-direct from old domain to new domain, for which you kindly provided the solution for htaccess file.

    Then there is about 30 urls that have no direct match on 'new domain' so I will need to re-direct

    www.olddomain.com/author/fred to www.newdomain.com/author/beryl

    Another example is:

    www.olddomain.com/author/fred/page/2 to www.newdomain.com/author/beryl/page/2

    These are only authors in a wordpress site, so maybe I shouldn't bother re-directing the 30 urls to the new author on the new site.

    And I should just stick with Domain re-direct you supplied earlier.?
  16. #9
  17. No Profile Picture
    Contributing User
    SEO Chat Adventurer (500 - 999 posts)

    Join Date
    Sep 2016
    Posts
    896
    Rep Power
    2129
    Put your orphaned urls first in your htaccess file ...
    Lines that start with a "#" are comment lines... so you know what you are doing....
    These line are order specific..

    # Start of htaccess file
    RewriteEngine on

    # Rewrite specific urls to new domain first
    # These are urls that have no identical url on new server

    Rewritecond http://www.olddomain.com/author/fred
    Rewriterule http://www.newdomain.com/author/beryl [L,R=301]

    Rewritecond http://www.olddomain.com/author/fred/page/2
    Rewriterule http://www.newdomain.com/author/beryl/page/2 [L,R=301,NC]

    # Now that we have taken care of the unique urls
    # Now Redirect the rest to new domain

    # This assumes you want www as your preferred url
    RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
    RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301,NC]

    # if you want non www use the bottom two links instead of the above two lines,
    # Just add the # to the above lines and remove the # from the next two line.

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

    #end of htaccess file
  18. #10
  19. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2016
    Posts
    21
    Rep Power
    0
    Excellent many thanks for that. It has been most helpful
  20. #11
  21. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2016
    Posts
    21
    Rep Power
    0
    Originally Posted by KnowOneSpecial
    Put your orphaned urls first in your htaccess file ...
    Lines that start with a "#" are comment lines... so you know what you are doing....
    These line are order specific..

    # Start of htaccess file
    RewriteEngine on

    # Rewrite specific urls to new domain first
    # These are urls that have no identical url on new server

    Rewritecond http://www.olddomain.com/author/fred
    Rewriterule http://www.newdomain.com/author/beryl [L,R=301]

    Rewritecond http://www.olddomain.com/author/fred/page/2
    Rewriterule http://www.newdomain.com/author/beryl/page/2 [L,R=301,NC]

    # Now that we have taken care of the unique urls
    # Now Redirect the rest to new domain

    # This assumes you want www as your preferred url
    RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
    RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301,NC]

    # if you want non www use the bottom two links instead of the above two lines,
    # Just add the # to the above lines and remove the # from the next two line.

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

    #end of htaccess file
    Not sure if I did somehting wrong, but I got 500 server error with the above.

    For the short term I just re-directed the domain and it works fine.

    I could send you an example of what I tried...

    I noticed after the first individual re-direct the ,NC was used? Should this have been the case for the first individual re-direct?
  22. #12
  23. No Profile Picture
    Contributing User
    SEO Chat Adventurer (500 - 999 posts)

    Join Date
    Sep 2016
    Posts
    896
    Rep Power
    2129
    Most likely the urls are not formatted correctly.

    Read the docs on it ....

    Edited to add...

    Maybe let it just redirect to the new domain. Let the 404 page catch it, then redirect it to the new correct page, like you said only a few of them to deal with right?
    Ends up being a single redirect on new site. so not much time lost.

    Here an example..just rudimentary, mind you,
    put this at the very top of our custom 404 page.

    Code:
    <?php
    
    $test_url =  $_SERVER['REQUEST_URI'];
    switch ($test_url) // 404 errors that we 301
    {
    case "/author/fred/page/2":
    header("HTTP/1.1 301 Moved Permanently"); 
    header("Location: https://www.newdomain.com/author/beryl/page/2 ");
    break;
    
    
    case "/author/fred/page/":
    header("HTTP/1.1 301 Moved Permanently"); 
    header("Location: https://www.newdomain.com/author/beryl/page/ ");
    break;
    }
    
    
    ?>
    Last edited by KnowOneSpecial; Mar 5th, 2017 at 03:18 PM. Reason: spelling correction
  24. #13
  25. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2016
    Posts
    21
    Rep Power
    0
    Thanks for that, they are author pages, so I am not sure it is the greatest issue.

    Something has just occurred which I wasn't expecting...the domain re-direct works well. ie from http://olddomain.com to https://www.newdomain.com

    But how do I re-direct

    http://www.olddomain.com
    https://olddomain.com

    To the new domain.?

    Many thanks for all you help so far
  26. #14
  27. No Profile Picture
    Contributing User
    SEO Chat Adventurer (500 - 999 posts)

    Join Date
    Sep 2016
    Posts
    896
    Rep Power
    2129
    I think you mean this... notice you just add the "s" to http to make it https

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
    RewriteRule ^(.*)$ https://www.newdomain.com/$1 [L,R=301,NC]
  28. #15
  29. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2016
    Posts
    21
    Rep Power
    0
    Hi

    Thanks for that, no I mean re-directing from

    So at the moment http:// myoldwebsite.com is re-directing to https:// mynewwebsite.com

    But when I visit https:// myoldwebsite.com or https:// www. myoldwebsite.com I get


    https:// myoldwebsite.com sent an invalid response. or myoldwebsite.com sent an invalid response. It doesn't re-direct to new website domain.

    Many thanks in advance
Page 1 of 2 12 Last
  • Jump to page:

Similar Threads

  1. New Site - OK to use new domain and 301 re-direct?
    By wisedave1 in forum SEO Help (General Chat)
    Replies: 1
    Last Post: Feb 13th, 2012, 07:47 PM
  2. Direct Linktrough from a certain domain to a main domain, Do or Don't?
    By R.A.Hasper in forum Search Engine Optimization
    Replies: 4
    Last Post: May 14th, 2010, 08:40 AM
  3. Will a Domain Re-direct hurt me?
    By tonynoriega in forum Google Optimization
    Replies: 4
    Last Post: Nov 11th, 2009, 02:36 AM
  4. Using Re-direct for registered Domain
    By amirsd in forum Google Optimization
    Replies: 1
    Last Post: Apr 3rd, 2009, 05:34 AM
  5. linkbacks: need 2 go direct to file or domain?
    By oopsbrokemyhip in forum Google Optimization
    Replies: 3
    Last Post: Oct 31st, 2005, 11:37 AM

IMN logo majestic logo threadwatch logo seochat tools logo