2011-01-12 18 views

回答

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

1

我猜(從標籤),你想這樣做的lighttpd的。在這種情況下,這將是:

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

你爲什麼不只是做一個文件go.php與以下網址http://www.example.com/go.php?site=http://www.example2.net

和文件go.php:

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

你應該做一些輸入驗證或者您介紹可能的HTTP響應拆分,見http://cwe.mitre.org/data /definitions/113.html – 2011-01-12 16:15:47

-1

假設你沒有URL重寫和/go包含一個index.php,你可以做