Redirect

bigeagle

New member
Joined
Oct 3, 2010
Messages
2
I'm trying to insert a new redirect for one of my domains through the API, but it won't work. He don't added the redirect. My code:

<?php
require_once 'DirectAdmin/HTTPSocket.php';
$sock = new HTTPSocket();
$sock->connect($_SERVER['SERVER_ADDR'],2222);
$sock->set_login("xx","xx");
$sock->set_method('POST');

$sock->query('/CMD_API_REDIRECT',
array(
'action' => 'add',
'domain' => domain.com',
'from' => '/hoi2',
'to' => 'http://www.nu.nl',
'apitype' => 'yes'
)
);
$result = $sock->fetch_body();
print_r($result);
?>

The output is: error=0&text=Redirect Added&details=

Does anyone know what I'm doing wrong?
 
Back
Top