1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Quick 301s Help

Discussion in 'White Hat SEO' started by acamso, Feb 16, 2016.

  1. acamso

    acamso Regular Member

    Joined:
    Sep 22, 2010
    Messages:
    232
    Likes Received:
    82
    Occupation:
    acamso.com
    Home Page:
    Hi, I am trying to set up a 301 redirect from an old site to a new site. I want to redirect the entire domain to the index page of the new site.

    I set up my .htaccess on the old site like this:

    Code:
    Redirect 301 / http://newsite.com
    But when I browse to, for example, "http://oldsite.com/test", it is redirected to "http://newsite.comtest/"

    Thanks
     
  2. sukataetumba

    sukataetumba Senior Member

    Joined:
    May 25, 2010
    Messages:
    1,122
    Likes Received:
    217
    You should be able to find what you need here

    Code:
    http://www.inmotionhosting.com/support/website/redirects/setting-up-a-301-permanent-redirect-via-htaccess
     
  3. asap1

    asap1 BANNED BANNED

    Joined:
    Mar 25, 2013
    Messages:
    4,961
    Likes Received:
    3,185
    I had this same problem for some reason.

    I just installed a 301 plugin on the money site so it would 301 every 404 to the homepage.

    Im sure its a better fix for it but it wasn't that important for me at the time and I was sleepy.
     
  4. seovistal

    seovistal Newbie

    Joined:
    Feb 16, 2016
    Messages:
    4
    Likes Received:
    1
    google search for the right code to move over your full site.
     
  5. Conor

    Conor Elite Member

    Joined:
    Nov 7, 2012
    Messages:
    3,577
    Likes Received:
    5,954
    Gender:
    Male
    Location:
    South Africa
    Home Page:
    Try something like this:

    Code:
    RewriteEngine on 
    RewriteRule ^(.*)$ http://www.newdomain.com/ [R=301,L]
    
    Source: http://stackoverflow.com/questions/1945568/htaccess-redirect-all-pages-to-new-domain
     
  6. Galleta

    Galleta Regular Member

    Joined:
    Dec 7, 2015
    Messages:
    270
    Likes Received:
    89
    Redirect 301 / http://newsite.com/

    or do the 301 directly at domain registrar (best solution)
    or what conor wrote.
     
  7. acamso

    acamso Regular Member

    Joined:
    Sep 22, 2010
    Messages:
    232
    Likes Received:
    82
    Occupation:
    acamso.com
    Home Page:
    Still no luck..

    Heres the htaccess on the new site if you can spot something:

    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
     
  8. acamso

    acamso Regular Member

    Joined:
    Sep 22, 2010
    Messages:
    232
    Likes Received:
    82
    Occupation:
    acamso.com
    Home Page:
    Any ideas anyone? :(
     
  9. Galleta

    Galleta Regular Member

    Joined:
    Dec 7, 2015
    Messages:
    270
    Likes Received:
    89
    What does not work exactly?
    Did you try the suggested solutions?

    The .htaccess of your new site is kind of irrelevant, you try to redirect the old site, correct?
     
  10. acamso

    acamso Regular Member

    Joined:
    Sep 22, 2010
    Messages:
    232
    Likes Received:
    82
    Occupation:
    acamso.com
    Home Page:
    Yes tried all of them. Yes redirect from old to new.

    The problem is:

    "http://oldsite.com/test" ==> "http://newsite.comtest/"

    Should be:

    "http://oldsite.com/test" ==> "http://newsite.com"
     
  11. acamso

    acamso Regular Member

    Joined:
    Sep 22, 2010
    Messages:
    232
    Likes Received:
    82
    Occupation:
    acamso.com
    Home Page:
    For those who have the same issue, I used this for the new site's htaccess:

    RewriteOptions inherit


    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^(.*)$ "http\:\/\/oldsite\.com" [R=301,L]
     
  12. PaperToy

    PaperToy Regular Member

    Joined:
    Jul 2, 2013
    Messages:
    334
    Likes Received:
    89
    This is the correct code to use to do exactly what you want:

    Code:
    [COLOR=#ff0000][B][FONT=Consolas]RewriteEngine on
    [/FONT][/B][/COLOR][B][COLOR=#ff0000]RewriteCond %{http_host} ^www.old.com [NC,OR]
    RewriteCond %{http_host} ^old.com [NC]
    RewriteRule ^(.*)$ http://www.thenewdomain.org/ [R=301,NC,L][/COLOR][/B]