php-phantomjs
php-phantomjs copied to clipboard
Incorrect return of $response->getStatus()
I always get int 301 even if it reached the site
I had the same problem. Say for example your URL is set to http://google.com - this will never return a 200 response, because it redirects to https://www.google.com. Make sure that you're adding the final destination URL after the redirect, or change the check to:
if($response->getStatus() === 200 || $response->getStatus() === 301) {
// Do stuff
}
I think it needs a follow redirect on https