title: File_get_contents failed to open stream: http request failed 404 not found
body: <p>I need to add an svg file to a website and apply a class to this svg. This is frustrating, I've tried different solutions posted on here and none of them have worked for me. This worked on a different server, but after being moved to a new server it no longer works. Here is how I am calling it in the php:</p>
  
  <pre><code>&lt;?php $svg = file_get_contents("http://www.folklorecoffee.com/wp-content/uploads/2018/04/folkloretextwhite-1.svg");
      $dom = new DOMDocument();
      $dom-&gt;loadHTML($svg);
      foreach($dom-&gt;getElementsByTagName('svg') as $element) {
          $element-&gt;setAttribute('class','logo-light');  
      }
      $dom-&gt;saveHTML();
      $svg = $dom-&gt;saveHTML();    
      echo $svg;?&gt;
  </code></pre>
  
  <p>I'm getting these warnings:</p>
  
  <p>WARNING:  file_get_contents(<a href="http://www.folklorecoffee.com/wp-content/uploads/2018/04/folkloretextwhite-1.svg" rel="nofollow noreferrer">http://www.folklorecoffee.com/wp-content/uploads/2018/04/folkloretextwhite-1.svg</a>): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
   in /home/folklorecoffee/public_html/wp-content/themes/lily/header.php on line 34</p>
  
  <p>WARNING:  DOMDocument::loadHTML(): Empty string supplied as input in  /home/folklorecoffee/public_html/wp-content/themes/lily/header.php  on line 36</p>
  
  <p>But when I test the url in my browser, it comes up fine. Not sure why I'm getting a 404 error. What am I doing wrong? Thank you in advance!</p>