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

Redirect question

Discussion in 'Black Hat SEO' started by ActionTaker, Dec 28, 2011.

  1. ActionTaker

    ActionTaker Power Member

    Joined:
    Jun 11, 2011
    Messages:
    606
    Likes Received:
    209
    Hi,

    I need some help redirecting a site.

    What I found is that I had to add

    Code:
    Redirect 301 / http://newdomain.com/
    To the htaccess file, which I did. It now redirects to the new domain but if I go to olddomain.com/1 and access it now it redirects to newdomain.com/1 and not simply newdomain.com. How can I change it so it redirects everything to the root domain and how can I do it so I redirect specific pages to specific pages? Say I wanted olddomain.com to redirect to newdomain.com/2 and everything else to the root, how is that done.

    I'm not a programmor so I feel a bit lost. Thanks for the help :)
     
  2. davids355

    davids355 Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 25, 2011
    Messages:
    8,785
    Likes Received:
    6,321
    Home Page:
    This will direct everything to new domain root.

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

    If you want to redirect few specific pages just do a static redirect above this code, like redirect 301 test2.HTML http://newsite.com/test2new.HTML

    Or whatever. If you want to map all pages to new pages with a match pattern it's a bit more complicated...
     
    • Thanks Thanks x 1
  3. davids355

    davids355 Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 25, 2011
    Messages:
    8,785
    Likes Received:
    6,321
    Home Page:
    No problem, just post back/pm me if you still have trouble:)
     
    • Thanks Thanks x 1
  4. ActionTaker

    ActionTaker Power Member

    Joined:
    Jun 11, 2011
    Messages:
    606
    Likes Received:
    209
    Thanks, rep added. I'll try it out later
     
    • Thanks Thanks x 1