php - Can curl HTTPS but not HTTP -


i can do:

curl https://feinternational.com/buy-a-website/9671-affiliate-e-commerce-survival-and-emergency-preparedness-34k-gross-mo 

but not:

curl http://feinternational.com/buy-a-website/9671-affiliate-e-commerce-survival-and-emergency-preparedness-34k-gross-mo 

the difference http , https. why that? how can make curl follow redirect https without me have modify url manually? curlopt_followlocation => true, doesn't work.

curl not follow redirect without -l option. looks website link shared has kind of rewritrule rewrite http pages https , hence not found error when curl.

if there no rewriterule http, able curl url.

if want use http https site, can use

curl -l "http://feinternational.com/buy-a-website/9671-affiliate-e-commerce-survival-and-emergency-preparedness-34k-gross-mo" 

-l follows redirect.

alternatively can write in php:

curl_setopt($ch, curlopt_followlocation, true); 

where $ch = curl_init();


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -