I have a tool to check redirects on a websites. The curl_setopt code for my php script:
$curl_arr[$i] = curl_init($url);
curl_setopt( $curl_arr[$i], CURLOPT_RETURNTRANSFER, 1);
curl_setopt( $curl_arr[$i], CURLOPT_SSL_VERIFYHOST, FALSE );
curl_setopt( $curl_arr[$i], CURLOPT_SSL_VERIFYPEER, FALSE );
curl_setopt( $curl_arr[$i], CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $curl_arr[$i], CURLOPT_ENCODING, "" );
curl_setopt( $curl_arr[$i], CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl_arr[$i], CURLOPT_AUTOREFERER, true );
curl_setopt( $curl_arr[$i], CURLOPT_CONNECTTIMEOUT, 5 );
curl_setopt( $curl_arr[$i], CURLOPT_TIMEOUT, 5 );
curl_setopt( $curl_arr[$i], CURLOPT_MAXREDIRS, 10 );
If I test 3 different websites:
http://praxis.nl
https://gamma.nl
http://www.karwei.nl
The outcome is as expected, they are all redirected to https://www. 301->200 (the first result takes 2 redirects, one for https and one for www 301->301->200)
However, when I try http://www.wheel+++point.nl (remove +++, done for indexing purposes) I get a 301 and then a status code of 0? if I try the final url directly https://www.wheel+++point.nl I DO get a 200.
I tried other tools. This one fails like mine: https://httpstatus.io/ This one DOES work: http://www.urlitor.com/
I first thought it was the website, but as the second tool does work, I start to think it is something in my script. Can anyone shed a light?
edit: The developer mentioned that some sites (with roughly the same htaccess) they created had the same problem, while a few others didn't. Not sure if it is a htaccess thing.