Reputation: 293
My website on my server does not want to show the on server saved image. The path is relative and to my information correct, but I always get a 404 error. Found no solution after browsing endlessly.
All nessecary information is found in the second picture posted.
Upvotes: 1
Views: 1283
Reputation: 6156
Apparently, you use a Framework. The file you have in the view
folder isn't the one you send to the browser, it's just a source file that will be used by your Framework entry point: public/index.php
. Your root folder is therefore public
.
Two things must then be understood:
application/view/index/index.php
, the browser will only see it as index.php
, located at the base of your site (http://localhost/index.php
or somethig like that). The relative path must therefore be written as relative to public
.public
, is seen as http://localhost
by the browser, you can't use ..
, there is nothing above the root of your website, for the browser. You must do one of the followings:
public/_images
instead of application/_images
(normally, all the files that can be sent without passing by the PHP preprocessor can go in public
)/images/(:any)
maps to a controller looking into your specific image folder (please, don't, it's not because you can that you should).My advice: create a public/img
folder and place it your images, then you load it with <img src="/img/title_image_me.jpeg" alt="My picture">
. (The initial /
is very important there!, it's understood as the root folder of your website, Linux-style).
Upvotes: 2