Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Redirect Script

  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Posts
    571
    Thanks
    25
    Thanked 28 Times in 28 Posts

    Redirect Script

    1) Project Details: (be as specific as possible):
    Simple redirect script with an IF statment.
    How it works:
    1. Person clicks my link
    2. IF referrer is http://www.facebook.com/ads/adboard/ redirect to www.site1.com. Else redirect to www.site2.com


    2) Payment Amount:
    I don't know. 10-20 bucks?
    3) Payment method/ details (Paypal, check? Timeline?):
    paypal
    4) Additional Info (about project or potential bidders):
    none
    Last edited by srule_; 12-05-2008 at 06:29 AM.

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Code:
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} ^http://www\.facebook\.com/ads/adboard/ [NC]
    RewriteRule * http://www.site1.com [R]
    Try saving that as ".htaccess" in the root web directory of site2.com.

  • #3
    Regular Coder
    Join Date
    Jul 2007
    Posts
    571
    Thanks
    25
    Thanked 28 Times in 28 Posts
    thanks :-)

  • #4
    Regular Coder
    Join Date
    Nov 2007
    Location
    127.0.0.1
    Posts
    348
    Thanks
    26
    Thanked 40 Times in 39 Posts
    If you are going for php:
    PHP Code:
    <?php

    $ref 
    $_SERVER['HTTP_REFERER'];
    switch(
    $ref){
    case  
    'http://www.facebook.com/ads/adboard/':
    header("Location:http://www.site1.com");
    break;
    default:
    header("Location:http://www.site2.com");
    }

    ?>
    Last edited by tagnu; 12-05-2008 at 06:45 AM.
    Blog Charity:Water
    WhatisWrongWith.me/tagnu - Send me anonymous feedback.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •