Web DevelopmentHTMLProgramming Languages-OtherUbuntuLinux
Last Comment
arnold
8/22/2022 - Mon
Dr. Klahn
If the server is rooted at "/var/www", then remove the ".." and it should work.
Side note: Path-relative file locations can cause trouble in HTML, and particularly so (n) years down the road when things are rearranged. Better to keep image files in the same locations as the HTML files which use them, or in dedicated subdirectories e.g., "/graphics/standard/image32.png"
Peter Chan
ASKER
I removed ".." but no improvement. How to check if it is rooted at "/var/www"?
arnold
without knowing where your HTML file in relation to the pict folder it is hard to answer.
Commonly, the baseline of content is in /var/www/html root of the default web site.
/var/www is outside the web servers data such that placing pict here, and then an index.html in /var/www/html will never reach it
i.e. while you think ../pict from html will be valid, within the web server the index.html is at / and ../ still means /.
i.e. cd /
cd ../
pwd
meaning in the web server your /var/www/html is the root / your html page says ../pict is being translated /pict which is /var/www/html/pict within the file system. Based on your description, the pict folder under /var/www/html/ does not exist and thus the error 403/4 no such directory or file......
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Bernard Savonet
If you have access to the shell
1 - what is rtge address of your web page? in most situarions would be /var/www/ or (on recent systelms) /var/www/html/ )
2 - what are the access rights and owner of your jpg file? in most cases owners would be www-data:www-data and rwxr-xr-x (or 755)
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Side note: Path-relative file locations can cause trouble in HTML, and particularly so (n) years down the road when things are rearranged. Better to keep image files in the same locations as the HTML files which use them, or in dedicated subdirectories e.g., "/graphics/standard/image3