Redirect problem when using API's

I have installed Piwik in this path:


http://localhost/website/piwik 

The following code exitst in http://localhost/website/site/test:


$result = file_get_contents("http://localhost/website/piwik/index.php?module=API&method=VisitsSummary.getVisits&idSite=1&period=day&date=last10&token_auth=4e4ae57a603004510ba30df14b9878d4");
var_dump($result); 

when getting to http://localhost/website/site/test adderss, browser will be redirect to http://www.localhost.com/website/site/test.
What’s the problem?