kkajzar
kkajzar

Reputation: 111

curl: 301 moved pernamently, browser see page

I have problem with curl

curl http://store.ebizmarts.com/media/feeds/Ebizmarts_MageMonkey.xml

this or any other url return 301. The same urls in browsers are working fine.

php5.5

curl --version
curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets 

I don't know where should I looking for resolve.

Thanks for time!

Upvotes: 1

Views: 88

Answers (1)

Federkun
Federkun

Reputation: 36964

If you want follow the redirect, you need to supply the -L options to curl.

curl -L http://store.ebizmarts.com/media/feeds/Ebizmarts_MageMonkey.xml

In php:

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

Upvotes: 4

Related Questions