[Tech] Redirections in PHP file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brassmonkey
    Pay It Forward
    • Sep 2005
    • 77396

    #1

    [Tech] Redirections in PHP file

    this is copied. i modified some of it.

    I'm using this php jump script for my affiliate links.

    Simply copy and paste following code to a text editor on your PC. I use Pspad

    Code:
    <?php
    $v = $_GET['v'];
    // In case someone calls naked php file
    if ($v == '') {$link = 'http://pornstuffarooni.com/';}
    
    // Add as many as links in below format. Each in a new line.
    if ($v == 'fish') {$link = 'http://sexoidfsh.com/';}
    if ($v == 'oils') {$link = 'http://fundepwe.com/';}
    if ($v == 'grapes') {$link = 'http://grapeapewatreu.com/';}
    
    // Don't change anything below this line.
    header("Location: $link") ;
    exit();
    ?>
    i named the php file ads
    ads.php and uploaded to /go/ directory, linking to following URL will redirect user to example1.com.

    Code:
    http://pornstuffarooni.com/go/ads.php?v=fish
    Block Search Engines from Crawling and Indexing PHP files
    We don't want Google to crawl these redirections. We can easily prevent it and other bots from crawling these files by blocking access to the directory. So open your robots.txt file and add following code to it.

    Code:
    User-agent: *
    disallow: /go/*
    TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
    DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com
  • rowan
    Too lazy to set a custom title
    • Mar 2002
    • 17393

    #2
    I would also add a header that explicitly changes the HTTP response code to 302:

    header("HTTP/1.0 302 redirect");
    header("Location: $link");

    Comment

    • rowan
      Too lazy to set a custom title
      • Mar 2002
      • 17393

      #3
      You also have no default case. If $v isn't fish/oil/grapes then your server will tell the browser to redirect to a blank URL.

      Comment

      • brassmonkey
        Pay It Forward
        • Sep 2005
        • 77396

        #4
        Originally posted by rowan
        You also have no default case. If $v isn't fish/oil/grapes then your server will tell the browser to redirect to a blank URL.
        i actually use this. i have not had any issues. have sent over a million clicks this year through it
        TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
        DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

        Comment

        • brassmonkey
          Pay It Forward
          • Sep 2005
          • 77396

          #5
          bump for friday
          TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
          DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

          Comment

          • brassmonkey
            Pay It Forward
            • Sep 2005
            • 77396

            #6
            Originally posted by rowan
            I would also add a header that explicitly changes the HTTP response code to 302:

            header("HTTP/1.0 302 redirect");
            header("Location: $link");
            added and thank you kindly.
            TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
            DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

            Comment

            Working...