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

How to redirect all pages of old domain to new urls?

Discussion in 'Black Hat SEO' started by MyspaceisstillCool, Feb 21, 2015.

  1. MyspaceisstillCool

    MyspaceisstillCool BANNED BANNED

    Joined:
    Feb 16, 2015
    Messages:
    304
    Likes Received:
    36
    I have a few thousand pinterest pins which all point to different pages on one of my websites.

    I want them redirected to a php script which will then redirect to random affiliate links. I know how to redirect just the domain in the hosting but not how to do all urls.

    How to do it?
     
  2. sergey007

    sergey007 Jr. VIP Jr. VIP

    Joined:
    Nov 13, 2014
    Messages:
    870
    Likes Received:
    327
    Location:
    pbn.rocks
    You can use .htacess rule to redirtect all pages:
    RewriteEngine on
    RewriteCond %{http_host} ^www DOT old DOTcom [NC,OR]
    RewriteCond %{http_host} ^old DOT com [NC]
    RewriteRule ^(.*)$ thenewdomain DOT org/ [R=301,NC,L]
     
    • Thanks Thanks x 1
    Last edited: Feb 21, 2015
  3. imbehindyou

    imbehindyou Newbie

    Joined:
    Mar 9, 2014
    Messages:
    11
    Likes Received:
    1
    use a 301 redirect on all the domain. It's will transfer to the new site and transfer the link juice also !
     
    • Thanks Thanks x 1
  4. webonic

    webonic Junior Member

    Joined:
    Jun 27, 2014
    Messages:
    127
    Likes Received:
    12
    Why $1 ?? I also want to use this but it popups me an error
     
  5. MyspaceisstillCool

    MyspaceisstillCool BANNED BANNED

    Joined:
    Feb 16, 2015
    Messages:
    304
    Likes Received:
    36
    but with a 301 does it not just replace olddomain/thispage to newdomain/thispage?
     
  6. MyspaceisstillCool

    MyspaceisstillCool BANNED BANNED

    Joined:
    Feb 16, 2015
    Messages:
    304
    Likes Received:
    36
    -edit-


    15 chars......
     
  7. MyspaceisstillCool

    MyspaceisstillCool BANNED BANNED

    Joined:
    Feb 16, 2015
    Messages:
    304
    Likes Received:
    36
    Can i send them to a php script on the same domain or will that screw it up?

    I want to send all urls to x.php. I would prefer have it on the same domain but would find another one if it would be tricky.
     
  8. watsonovedades

    watsonovedades Senior Member

    Joined:
    Mar 10, 2011
    Messages:
    922
    Likes Received:
    235
    Location:
    Mexico
    you can create a subfolder for the script
    domain.com/offers/script.php

    Cheers
     
    • Thanks Thanks x 1