Redirect API list options

Djunity

Verified User
Joined
Mar 9, 2008
Messages
243
Location
Holland
Hi all,

Im currently working on some api functions to build in or customer panel.
Im have a function whit this line
PHP:
$sock->query('/CMD_API_REDIRECT', array('apitype'=>'yes','domain' => $domaintld,'urlencoded'=>'yes'));

I also tryd with:
PHP:
$sock->query('/CMD_API_REDIRECT', array('domain' => $domaintld));

To make it clear this is the only output i get:
PHP:
array(2) {
  [0]=>
  string(31) "http%3A%2F%2Fwww%2Etest%31%2Enl"
  [1]=>
  string(31) "http%3A%2F%2Fwww%2Etest%32%2Enl"
}

This only gives the redirect to value not the type and the start path.

Am i doing something wrong or isnt it possible to show those values over the api ?
 
Last edited:
Hello,

Test with a browser, eg:
http://[b]yourdomain.com[/b]:2222/CMD_API_REDIRECT?domain=domain.com

I get the full output, eg:
Code:
%2Fredirect=http%3A%2F%2Fwww%2Edirectadmin%2Ecom
John

Hi John,

I use the http request class found on da site http://www.directadmin.com/forum/showthread.php?threadid=258 workin fine for other api commands.

I now see the localpath but im still missing the type value aka 302,301 i dont see it in the output you get to, so basicly is that value returned on the api command ?

I think the output should be something like
Code:
local_path=%2Fredirect&type=301&url=http%3A%2F%2Fwww%2Edirectadmin%2Ecom
 
Last edited:
Hi John,

Got it now strangly enough it didn't work becouse the array build in the function.

Now need to sort the output and then it's ok thanks.
 
Back
Top