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

301(?) Redirect

Discussion in 'White Hat SEO' started by fad3r, Dec 19, 2011.

  1. fad3r

    fad3r Power Member

    Joined:
    Sep 17, 2011
    Messages:
    733
    Likes Received:
    115
    Location:
    nyc
    Hi,
    Does anyone know how to set one of these up? I have a few sites I would like to point to one master site.
     
  2. mark0v

    mark0v Junior Member

    Joined:
    May 6, 2010
    Messages:
    114
    Likes Received:
    20
    PHP:
    <?php
    header
    ("HTTP/1.0 301 bounce");
    header("Location: http://domain.com");
    header("Connection: close");
    ?>
    or you could do it via .htaccess
     
    • Thanks Thanks x 1
  3. sevenfigurez

    sevenfigurez Junior Member

    Joined:
    Nov 5, 2009
    Messages:
    183
    Likes Received:
    46
    The following code redirects all pages from Domain A, to corresponding pages on Domain B

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

    subster Elite Member

    Joined:
    Apr 5, 2008
    Messages:
    1,864
    Likes Received:
    1,448
    Location:
    Krauthausen
    easiest is to fill in this into the .htaccess files:

    Code:
    redirect 301 / http://www.newdomain.de
     
  5. hellohellosharp

    hellohellosharp Power Member

    Joined:
    Dec 8, 2010
    Messages:
    625
    Likes Received:
    552
    Occupation:
    CEO @ CLEANFILES LLC
    Location:
    USA
    Home Page:
    This is the most google-friendly option :D
     
  6. Edward B

    Edward B Newbie

    Joined:
    Dec 27, 2007
    Messages:
    21
    Likes Received:
    3
    Which one is the most google-friendly, the .htaccess method?
     
  7. sevenfigurez

    sevenfigurez Junior Member

    Joined:
    Nov 5, 2009
    Messages:
    183
    Likes Received:
    46
    There is no 'google friendly' method. They all do the same thing.

    I like using .htaccess
     
  8. Edward B

    Edward B Newbie

    Joined:
    Dec 27, 2007
    Messages:
    21
    Likes Received:
    3
    Thank you.
     
  9. britcpa

    britcpa Power Member

    Joined:
    Mar 25, 2010
    Messages:
    509
    Likes Received:
    1,384

    thats what i wondered, the answer is a bit ambiguous isnt it. any goorooos out there who can confirm one way or another or will i have to wade through more andy jenkins written material :eek:
     
  10. fathobbitsss

    fathobbitsss Junior Member

    Joined:
    Jun 17, 2011
    Messages:
    106
    Likes Received:
    21
    yea go with a htaccess wildcard 301, google it
     
  11. captchadreams

    captchadreams Power Member

    Joined:
    Sep 19, 2008
    Messages:
    504
    Likes Received:
    131
    can anyone help me? I'm trying to redirect any subdomain to the original domain.

    IE:

    wtf.domain.com/whatever/ ---> domain.com/whatever/
    asdf.domain.com/blah/ ----> domain.com/blah/
    etcetc

    I've been messing with the .htacces for a while now and can't get it figured out.

    tried:
    http://www.easymodrewrite.com/example-subdomains
    http://stackoverflow.com/questions/...c-from-subdomain-to-domain-without-maintainin
    plus about 10 others from stackoverflow

    I'm wondering if it's maybe the host I'm using or something (1and1).. they've been known to screw up other things that normally work on other hosts.. so i'm not sure.

    placed the .htaccess file in the folder root of the domain.. i know that the .htacess file is working cause i have wordpress setup.. maybe that's interferring? not sure.

    here's a sample of the last thing I had tried.

    Code:
    AddType x-mapp-php5 .php
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteRule (.*) http://mydomain.info/$1 [R=301,L]
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    </IfModule>
    
    # END WordPress