Micro Niche Builder
Closed Thread
Results 1 to 7 of 7

Thread: redirect to input url

  1. #1

    Default redirect to input url

    Does anyone know how to redirect a visitor to a url that is input in the url? Ok, this isn't making much sense. What I want to do is something similar to what linkanon.com does except with my own domain instead of their's


  2. Micro Niche Builder

  3. #2

    Default

    If you know anything about php this should be a very simple script.

    You can use the redirect function to do this and then use a simple GET to get the url.

    If you want a script written for you I will do it for you for 20 points or something. PM me if you are interested.

  4. #3

    Default

    I know how to redirect, but how do you take an input from the url? I don't actually know that much php. Only a little bit for wordpress purposes.If you can make it so that the input can come from the url, then I'll give you the 20 points.

  5. #4

    Default

    The simplest solution (maybe not so "beauty" but works).

    Let's take the url.

    www.thelink.com/?r=www.google.com

    inside the index.php we put the code

    <?
    if(stristr($r, 'http') === FALSE) {
    $r='Location: http://'.$r;
    }
    else {
    $r='Location: '.$r;
    }

    header( $r ) ;
    ?>
    This code MUST be placed on the first position - before HTML tags, otherworks it will not work.

    If it still not works there might be "register_globals" set to OFF. In that case, before that code insert this:

    <?
    if (!ini_get('register_globals')) {
    $types_to_register = array(
    'GET','POST',
    'COOKIE','SESSION','SERVER'
    );
    foreach ($types_to_register as $type) {
    if (@count(${'_' . $type}) > 0) {
    extract(${'_' . $type}, EXTR_OVERWRITE);
    }
    }
    }
    ?>
    Together it should work just fine. Some explonations:

    That "if..." statment determines the format of given URL - with or without trailing "http://". If there's no "http" it simply adds it.

  6. #5

    Default

    I forgot... The construction "link.com/?r=someurl.com" should work, but in some (rare) cases it's necessary to put the file name between the path and the parameter (eg. link.com/index.php?r-someurl.com". It depends on server configuration...

  7. #6

    Default

    Amazing, it definitely works. Now I can update my blog link exchanges with some lower rated PR sites. I think linking to all of them directly might hurt my SEO, so I'm choosing to keep some of the links internal.

  8. #7

    Default

    Quote Originally Posted by claire333
    Amazing, it definitely works. Now I can update my blog link exchanges with some lower rated PR sites. I think linking to all of them directly might hurt my SEO, so I'm choosing to keep some of the links internal.
    Except it will not affect PR of the sites that you're linking to, because google will treat such link as an internal link
    But the good site of it is that you can simply build "link stats" around this code - eg. how many times the link was clicked, who did it etc...

Closed Thread

Bookmarks

Posting Permissions

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