<p>The issue is that your Asset Volume URL is <code>@web/image</code> but your Asset Volume path is <code>@webroot/assets/art</code></p>

<p>That means that Craft will look for the images on disk (to do transforms, etc.) in <code>web/assets/art</code> but it will generate URLs for frontend requests that point to <code>http://example.com/image</code> -- where presumably nothing exists.</p>

<p>These should probably be:</p>

<ul>
<li>URL: <code>@web/assets/art</code></li>
<li>Path: <code>@webroot/assets/art</code></li>
</ul>

<p>...assuming that the <code>web/assets/art/</code> directory is where these images live.</p>

CC BY-SA 4.0
2018-08-28T17:23:32.513Z
Thank you, this worked perfectly. Question: what if I want to have my images stored outside webroot, but have public URLs? How can I achieve that? Thank you
Dwarf Vader
CC BY-SA 4.0
2018-08-28T19:24:25.437Z
It can be done, but why would you want to do that?
andrew.welch
CC BY-SA 4.0
2018-08-28T21:38:18.653Z
I want to find out what the system is capable of and what its limitations are
Dwarf Vader
CC BY-SA 4.0
2019-03-11T07:31:51.797Z
@andrew.welch, can you elaborate on the configuration required for storing the assets on disk outside of the web root?

My use case for doing this is in a development environment where I'd like the base asset path to be an environment variable storing a path to a shared disk location where assets are maintained for all developers that are developing the site.

I can serve the assets from another base path using some Nginx configurations, but I'm interested to know if it's possible without this.
Tim Everts
CC BY-SA 4.0
2018-08-28T17:16:26.223Z
2018-08-28T17:16:26.223Z
andrew.welch
<p>I wanted to include some uploaded assets (images) in an entry. The <code>.url</code> property in twig outputs the proper URL, in my case:</p>

<blockquote>
  <p><a href="http://localhost/craftcms/web/image/photo-2017-04-02-16-20-53-1.jpg" rel="nofollow noreferrer">http://localhost/craftcms/web/image/photo-2017-04-02-16-20-53-1.jpg</a></p>
</blockquote>

<p>However, that link is broken. Following it leads to a 404 error page:</p>

<blockquote>
  <p>Template not found: image/photo-2017-04-02-16-20-53-1.jpg</p>
</blockquote>

<p>Viewing it in the admin panel preview also displays a broken image sign.</p>

<p>If I disable the Public URL switch in the asset settings, the image display fine in the admin panel, but obviously I cannot use them in public pages.</p>

<p>I wasn't able to find a working fix for this. I tried the multiple-environment config solution from these forums just in case, but it did not help me.</p>

<p>Update: here is a screenshot of my Assets volume settings:
<a href="https://i.sstatic.net/a3bhV.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/a3bhV.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2018-08-24T14:14:38.060Z
What did you set the File System Path and the URL to? Is this a Craft 2 build?
Jay
CC BY-SA 4.0
2018-08-24T14:38:57.807Z
The public URL needs to be publicly accessible, so in your web root folder. (the "web" folder by default in a craft3 project)

Is your assets folder in there?
billythekid
CC BY-SA 4.0
2018-08-24T19:24:25.330Z
This is a Craft 3 install. The public URL is indeed publicly accessible - inside the web folder as you suggested (see original post). The file system path - I also tried putting it in the web folder, as well as outside of it. No avail
Dwarf Vader
CC BY-SA 4.0
2018-08-27T14:51:23.317Z
Can you please update your question with a screenshot of the Asset volume settings?
Jalen Davenport
<assets><url><routing>
Asset (image) public URL does not work
# Asset (image) public URL does not work

(Asked by: username_0 on 2018-08-24)

I wanted to include some uploaded assets (images) in an entry. The `.url` property in twig outputs the proper URL, in my case:

> <http://localhost/craftcms/web/image/photo-2017-04-02-16-20-53-1.jpg>

However, that link is broken. Following it leads to a 404 error page:

> Template not found: image/photo-2017-04-02-16-20-53-1.jpg

Viewing it in the admin panel preview also displays a broken image sign.

If I disable the Public URL switch in the asset settings, the image display fine in the admin panel, but obviously I cannot use them in public pages.

I wasn't able to find a working fix for this. I tried the multiple-environment config solution from these forums just in case, but it did not help me.

Update: here is a screenshot of my Assets volume settings:
[![enter image description here](https://i.sstatic.net/a3bhV.png)](https://i.sstatic.net/a3bhV.png)

**Tags:** assets, url, routing

> **Comments:**
> **username_1**: What did you set the File System Path and the URL to? Is this a Craft 2 build?  
> **username_2**: The public URL needs to be publicly accessible, so in your web root folder. (the "web" folder by default in a craft3 project)  Is your assets folder in there?  
> **username_0**: This is a Craft 3 install. The public URL is indeed publicly accessible - inside the web folder as you suggested (see original post). The file system path - I also tried putting it in the web folder, as well as outside of it. No avail  
> **username_3**: Can you please update your question with a screenshot of the Asset volume settings?  

---

## 1 answers

### Answer by username_4 on 2018-08-28. Score: 7 | Accepted answer

The issue is that your Asset Volume URL is `@web/image` but your Asset Volume path is `@webroot/assets/art`

That means that Craft will look for the images on disk (to do transforms, etc.) in `web/assets/art` but it will generate URLs for frontend requests that point to `http://example.com/image` -- where presumably nothing exists.

These should probably be:

* URL: `@web/assets/art`
* Path: `@webroot/assets/art`

...assuming that the `web/assets/art/` directory is where these images live.

> **Comments:**
> **username_0**: Thank you, this worked perfectly. Question: what if I want to have my images stored outside webroot, but have public URLs? How can I achieve that? Thank you  
> **username_4**: It can be done, but why would you want to do that?  
> **username_0**: I want to find out what the system is capable of and what its limitations are  
> **username_5**: @username_4, can you elaborate on the configuration required for storing the assets on disk outside of the web root?  My use case for doing this is in a development environment where I'd like the base asset path to be an environment variable storing a path to a shared disk location where assets are maintained for all developers that are developing the site.  I can serve the assets from another base path using some Nginx configurations, but I'm interested to know if it's possible without this.  

---

