On the hosting server (Cloudlinux OS) in the root directory there are 2 neighboring directories — public_html and images. In images there is a file alpha.png and in public_html a file index.html.
In index.html I write:

<div id="head"> <img src="../images/alpha.png" alt="picture 1" height="60px"> </div> 

but the drawing does not load.

".." means that you need to go to the previous directory, i.e. in the root, then you need to go to the images folder and find the file alpha.png.

ps If the images directory and the index.html file are side by side in the same public_html directory, then this code works:

  <div id="head"> <img src="images/alpha.png" alt="picture 1" height="60px"> </div> 

enter image description here

    2 answers 2

    You, IMHO, the images folder is outside the directory specified as the RootDirectory for the site. Check it out.

    • one
      Andrew, see the photo added - Delphi159
    • That's right, your images folder is outside the root directory of the site. You have Apache does not let you to the level above the public_html directory. move the images folder to the public_html folder or, if the location of the images folder is exactly where you currently have it, just create a symbolic link to it in the public_html directory - Andrey
    • Strange! And I thought that the root directory is the one at the very top, that is, / home / edelin and public_html and images are adjacent. Do you mean to create a normal link in public_html? - Delphi159
    • ln -s ~/images ~/public_html/images - Andrey
    • and yes, the public_html directory is the root directory of the site, and the /home/edelin directory is the home directory of your account on the server - Andrey

    public_html is the root directory for your primary domain. All files and directories, including images must be located inside.
    ../ does not work, because you are trying not to go to the root directory, but beyond it.

    ps Your version of ps is correct.

    • Sjeurt, see photo added - Delphi159