如何使用Lighttpd从此URL重定向?

时间:2011-01-12 15:50:03

标签: php lighttpd

如何从http://www.example.com/go/?http://www.example2.net重定向到http://www.example2.net

4 个答案:

答案 0 :(得分:1)

我猜(来自标签)你想在lighttpd中这样做。在这种情况下,它将是:

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

答案 1 :(得分:0)

为什么不用以下网址http://www.example.com/go.php?site=http://www.example2.net制作文件go.php:

和文件go.php:

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

答案 2 :(得分:0)

创建文件link.php并设置全局变量

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

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

然后访问http://www.example.com/link.php?go=http%3A%2F%2Fwww.example2.net

答案 3 :(得分:-1)

假设您没有重写URL并且/go包含index.php,您可以这样做