[Gandi][API] Redirection web

 'domain.', 'sslverify' => False  )
);
define('API_KEY', 'MY_API_KEY');
///////////////////
// Create a webdir
///////////////////
$redirec_spec = [
   'host' => 'redirection',
   'url' => 'http://my_other_domainname.info',
   'type' => 'http302',
];
$result = $api->__call( 'webredir.create', array(API_KEY,'my_domainname.fr', $redirec_spec));
print_r($result);
// http://redirection.my_domainname.fr => http://my_other_domainname.info
///////////////////
// Update a webdir
///////////////////
$redirec_spec = [
   'host' => 'newredirection',
   'url' => 'http://other_domainname.info',
   'type' => 'http302',
];
$result = $api->__call( 'webredir.update', array(API_KEY,'my_domainname.fr', 'redirection', $redirec_spec));
print_r($result);
// Replace 'redirection' by 'newredirection'
// http://newredirection.my_domainname.fr => http://other_domainname.info
?>

Comments are closed, but trackbacks and pingbacks are open.