dongwen7380 2018-07-10 01:00
浏览 31

奇怪的卷曲结果php(301 - > 0)

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 各位请问平行检验趋势图这样要怎么调整?说标准差差异太大了
    • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
    • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
    • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗
    • ¥15 运动想象脑电信号数据集.vhdr
    • ¥15 三因素重复测量数据R语句编写,不存在交互作用
    • ¥15 微信会员卡等级和折扣规则
    • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
    • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
    • ¥15 gdf格式的脑电数据如何处理matlab