How can I redirect an ajax request in php/wordpress.
I tried header("Location: " . "http://redirect.url");
but it doesn’t work, the response has 301 Moved Permanently
status and the request fails.
How can I redirect an ajax request in php/wordpress.
I tried header("Location: " . "http://redirect.url");
but it doesn’t work, the response has 301 Moved Permanently
status and the request fails.
You must be logged in to post a comment.
You cannot redirect from php by an ajax request. Instead of that you need to do it inside your javascript.
For example if this is your ajax then after success of your request redirect from ajax itself