开发者

How to redirect from this url using Lighttpd?

How can I redirect from http://www.ex开发者_开发百科ample.com/go/?http://www.example2.net to http://www.example2.net?


I guess (from tags) you want to do this in lighttpd. In such case it would be:

url.redirect  = ( "^/go/\?(.*)$" => "$1" )


Create a file link.php and set a global variable

<?php
$external = $_GET['go'];

// If a preloader header('Refresh: 4; url=' . $external);
header('Location: ' . $external);
?>

Then visit http://www.example.com/link.php?go=http%3A%2F%2Fwww.example2.net


Why don't you just make a file go.php with the following url http://www.example.com/go.php?site=http://www.example2.net:

and the file go.php:

<?php
        header("Location: {$_GET['site']}");
        exit;
?>


Assuming you have no URL rewriting and /go contains an index.php, you could do

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜