no coockie and proxy user redirect
Started on the old forum in March 2012 · view the original in the archive · old links redirect here
I like rapidshares Proxy redirection setup that redirects web proxys to there site without the proxy... im guessing it is done on finding out what the url is but im unsure how you go about redirecting it to same page without the web proxy being used
for your answer:
//code removed as incorrect .... use gums code below :P
at a guess on web proxys:
if($_SERVER['REQUEST_URI']!="your file path")
{
header("Location: http://yoursite.con");
exit;
}
for proxy, the example by something else if also good for some web proxies
if ($_SERVER['HTTP_X_FORWARDED_FOR'] || $_SERVER['HTTP_X_FORWARDED'] || $_SERVER['HTTP_FORWARDED_FOR'] || $_SERVER['HTTP_VIA'])
{
header('Location: http://yoursite.com');
}
and for cookie first of all set cookie for example on index page add after <?php:
setcookie("your_cookie_name", 1, time()+3600); /* expire in 1 hour */
on subpages add this:
if (!isset($_COOKIE['your_cookie_name']))
{
header('Location: http://yoursite.com/index.php'); /* if no cookie set, redirect back to index (all browsers which dont support cookies will be redirected to the index page all the time */
}
Advertise your mobile site for FREE with AdTwirl
I like gums solution.many proxy servers use x_forwarded_for . to try to give a coockie and request this , is a nice solution. thank you gum.i will setup this.
GumSlone wrote: for proxy, the example by something else if also good for some web proxies
if ($_SERVER['HTTP_X_FORWARDED_FOR'] || $_SERVER['HTTP_X_FORWARDED'] || $_SERVER['HTTP_FORWARDED_FOR'] || $_SERVER['HTTP_VIA']) { header('Location: http://yoursite.com'); }and for cookie first of all set cookie for example on index page add after <?php:
setcookie("your_cookie_name", 1, time()+3600); /* expire in 1 hour */on subpages add this:
if (!isset($_COOKIE['your_cookie_name'])) { header('Location: http://yoursite.com/index.php'); /* if no cookie set, redirect back to index (all browsers which dont support cookies will be redirected to the index page all the time */ }