PHP API Red_Item parameters update – something changed
-
I’m using the plugin for a good while now, and we’re really happy with it.
On the website I’m working on we have set up the creation of redirects with the PHP Api, this worked fine until a month or so ago, but I can’t pin point the exact time it stopped (I didn’t regularly update the plugin, we do have the latest version at the moment though).I’m using Red_Item::create ( from the documentation https://redirection.me/developer/php-api/ ) to set up 301 redirects, and at the moment the redirects created don’t work anymore.
The change I see is that they are created with the following option selected:
Match: “URL and server”
If I’m updating this manually to “URL only” (and update the target url) it works.So this is what we set up at the moment – it probably just needs some parameter to be updated I guess so the redirect is set to “URL only” from the start:
$redirectData = array( 'url' => $fromURL, 'action_code' => 301, 'action_data' => array('url' => $toURL), 'action_type' => 'url', 'match_type' => 'url', 'match_data' => array( 'source' => array( "flag_case" => true, "flag_trailing" => true ) ), 'group_id' => 1 ); $result = @Red_Item::create($redirectData); //result processing follows
The vars $fromURL and $toURL contain the source and target url.
- The topic ‘PHP API Red_Item parameters update – something changed’ is closed to new replies.