# Copy() works only sometimes

**URL:** <https://forum.kirupa.com/t/copy-works-only-sometimes/268715>\
**Category:** Uncategorized\
**Created:** [August 17, 2008, 9:41pm UTC](https://forum.kirupa.com/t/copy-works-only-sometimes/268715 "2008-08-17T21:41:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [August 17, 2008, 9:41pm UTC](https://forum.kirupa.com/t/copy-works-only-sometimes/268715/1 "2008-08-17T21:41:35Z")

</div>

I use

```php

copy($url, $localFolder);

```

to copy remote images to my local host. It works with image URL’s which have “www”, but doesn’t work when the URL doesn’t have “www” (most likely because its URL is [http://subdomain.domain.com/image.jpg](http://subdomain.domain.com/image.jpg)). An example is:

![](http://forum.kirupa.com/uploads/kirupa/4887/a9a5550b8a7add4f.jpg)

I get this error in my browser:

```auto

Firefox can't find the server at www.

```

Do you know where I can insert the “www” to make this work?
