file_get_contents returning a 404 with a valid and working URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Matt Black

    #1

    file_get_contents returning a 404 with a valid and working URL

    Hi all,

    I'm not sure what is happening with this URL.

    I have this same script running with 4 URLs, but this one is the only one returning a 404 when using file_get_conten ts.

    Just in case, allow_url_fopen is On

    This is the URL: http://www.ofertasimpl e.com/buenos-aires

    This is the code:
    Code:
    <?php
    
    header('Content-Type: text/html; charset=UTF-8');
    
    $da = file_get_contents('http://ofertasimple.com/buenos-aires/');
    
    echo $da;
    
    ?>

    May this be related to headers? or a security method to prevent content being retrieved?

    Thanks in advance!
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    you've probably tested the URL from your PC, but does the server access that URL?

    check spelling as well. (copy paste)

    try to ping the domain name from the server or PHP code.

    Let us know,


    Dan

    Comment

    Working...