2

As a service, i want to access an image inside of "web/uploads". When i'm trying to do that, it's returning:

No route found for "GET /web/uploads/"

But i just want to access an image inside this directory. I'm uploading images and i need to load them externally. Any light to do this? Thanks.

Otuyh
  • 2,384
  • 5
  • 22
  • 40

1 Answers1

3

/web/ directory is you (public) document root, so it's the place where your domain points.

Assuming e.g. you have virtual host example.lc which points to /path/to/project/web/, then instead of requesting:

http://example.lc/web/uploads

You should try with:

http://example.lc/uploads

When you're trying to access:

http://example.lc/web/uploads

Webserver really looks for /path/to/project/web/web/uploads, and since this path doesn't exist, it rewrites the URL to app.php which is Symfony application entry point.

Jakub Matczak
  • 15,341
  • 5
  • 46
  • 64
  • I'd also like to point out to the OP that any static file server from the document root is in fact not processed by Symfony at all. These files are directly served by the HTTP server and do not pass the Symfony stack. – Gerry Sep 02 '16 at 08:47