GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   any wordpress plugin to redirect just part of the traffic ? (https://gfy.com/showthread.php?t=1173804)

klinton 09-13-2015 01:43 AM

any wordpress plugin to redirect just part of the traffic ?
 
like: 15 %, 25 %, etc. etc.

thx

sandman! 09-13-2015 01:50 AM

you could do that with most traffic trading scripts :2 cents::2 cents:

Denny 09-13-2015 02:04 AM

Bump for you :pimp

just a punk 09-13-2015 02:09 AM

You can order a custom one: cyberseo@cyberseo.net :2 cents:

klinton 09-13-2015 02:13 AM

I use wordpress, not traffic trading script :)
I tried to "hack it" by editing index.php and putting there random php array...and put as one of the options "normal site" with redirect to site.php instead of index.php
however, the problem is that now "normal" site doesnt load at all, there are just redirects...like wp_header.php call wouldnt work in file different than index.php....why ????
<?php

$urls[] = "http://www.originalsite.com/site.php";
$urls[] = "http://www.redirect1.com";
$urls[] = "http://www.redirect2.com";
$urls[] = "http://www.originalsite.com/site.php";

srand ((double) microtime( )*1000000);
$random = rand(0,count($urls)-1);

header("location:" . $urls[$random]);
exit;
?>

Quote:

Originally Posted by sandman! (Post 20578198)
you could do that with most traffic trading scripts :2 cents::2 cents:


freecartoonporn 09-13-2015 02:39 AM

dont know about wp, this can be done in plain php.

e.g.
php - how to redirect a % of traffic to different websites? - Stack Overflow

you just need to implement it in wp.

okie., you have already sorted that out, maybe someone familiar with wp can help.

j3rkules 09-13-2015 03:33 AM

Quote:

Originally Posted by CyberSEO (Post 20578208)
You can order a custom one: cyberseo@cyberseo.net :2 cents:

:thumbsup

klinton 09-13-2015 01:32 PM

bump for working solution....

sarettah 09-13-2015 02:55 PM

Quote:

Originally Posted by klinton (Post 20578545)
bump for working solution....

With what you had, change it up a touch and try this:

<?php

$urls[] = "";
$urls[] = "http://www.redirect1.com";
$urls[] = "http://www.redirect2.com";
$urls[] = "";

srand ((double) microtime( )*1000000);
$random = rand(0,count($urls)-1);

if(!empty($urls[$random]))
{
header("location:" . $urls[$random]);
exit;
}

?>

That way it should redirect into one of the other urls or drop into the page like normal. I would think that would work. Don't know what the SEs would think of it.

Edited in: I just dropped that into the top of one of my wife's blogs index.php and it worked fine. It does not give you the control by % but it does do the redirect. You could just do a little file read and keep track by counter of how many times you went to each url pretty easy to get that control.


.

fris 09-14-2015 04:05 AM

Quote:

Originally Posted by klinton (Post 20578195)
like: 15 %, 25 %, etc. etc.

thx

you could hook into a filter, and use the wp_redirect function.

fris 09-14-2015 04:54 AM

Code:

add_action('template_redirect', 'custom_redirect_url');

function custom_redirect_url() {
        if(is_home() ) {
                wp_redirect('http://google.ca');
                exit();
        }
}

this example here would redirect the main domain

you would just have to adapt your function (the redir algorithm or how often into this)

this would go in your functions file

fris 09-14-2015 05:07 AM

Code:

add_action('template_redirect', 'custom_redirect_url');

function custom_redirect_url() {

    $urls[] = "http://www.originalsite.com/site.php";
    $urls[] = "http://www.redirect1.com";
    $urls[] = "http://www.redirect2.com";
    $urls[] = "http://www.originalsite.com/site.php";

    srand ((double) microtime( )*1000000);
    $random = rand(0,count($urls)-1);
    $url = $urls[$random];

    // adapt your % redirect here if original isnt yours
    wp_redirect($url, 301);
    exit();
}

you would just need to adapt the % function
to redir

klinton 09-14-2015 08:45 AM

thanks guys ! I will play with it later ;-)

LatinaCamChat 09-14-2015 09:02 AM

what is your reasoning for wanting to do this within wordpress core (which will get overwritten quickly by wordpress's never ending update) instead of using one of the many traffic trading scripts that are compatible with wordpress or even often come in wordpress plugin format?

https://s-media-cache-ak0.pinimg.com...5197dfcf5d.jpg

fris 09-14-2015 09:14 AM

Quote:

Originally Posted by LatinaCamChat (Post 20579042)
what is your reasoning for wanting to do this within wordpress core (which will get overwritten quickly by wordpress's never ending update) instead of using one of the many traffic trading scripts that are compatible with wordpress or even often come in wordpress plugin format?

https://s-media-cache-ak0.pinimg.com...5197dfcf5d.jpg

theme wont be updated even when wp is, always use a child theme.

LatinaCamChat 09-14-2015 09:21 AM

Quote:

Originally Posted by fris (Post 20579050)
theme wont be updated even when wp is, always use a child theme.

themes also update sometimes though

child theme is fine I guess, just pretty sure there must be an easy plugin to do this already

klinton 09-14-2015 12:03 PM

gracias amigo, I will check out soon that traffic trading script "Compatible" with wordpress...but my guts say that it will totally fuck up my wordpress site ;-)

Quote:

Originally Posted by LatinaCamChat (Post 20579042)
what is your reasoning for wanting to do this within wordpress core (which will get overwritten quickly by wordpress's never ending update) instead of using one of the many traffic trading scripts that are compatible with wordpress or even often come in wordpress plugin format?

https://s-media-cache-ak0.pinimg.com...5197dfcf5d.jpg



All times are GMT -7. The time now is 05:36 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc