![]() |
any wordpress plugin to redirect just part of the traffic ?
like: 15 %, 25 %, etc. etc.
thx |
you could do that with most traffic trading scripts :2 cents::2 cents:
|
Bump for you :pimp
|
You can order a custom one: cyberseo@cyberseo.net :2 cents:
|
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:
|
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. |
Quote:
|
bump for working solution....
|
Quote:
<?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. . |
Quote:
|
Code:
add_action('template_redirect', 'custom_redirect_url'); you would just have to adapt your function (the redir algorithm or how often into this) this would go in your functions file |
Code:
add_action('template_redirect', 'custom_redirect_url'); to redir |
thanks guys ! I will play with it later ;-)
|
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 |
Quote:
|
Quote:
child theme is fine I guess, just pretty sure there must be an easy plugin to do this already |
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:
|
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