You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by JW...@clare.com on 2002/04/04 22:48:27 UTC

.jpg problems

On a recently built solaris server...
the web pages show up as advertised but not the .jpg pics.  when I view the
html directly I see the pics.  any ideas?
The permissions are set wide open.

Jeremey Weeks



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: .jpg problems

Posted by Owen Boyle <ob...@bourse.ch>.
JWeeks@clare.com wrote:
> 
> On a recently built solaris server...
> the web pages show up as advertised but not the .jpg pics.  when I view the
> html directly I see the pics.  any ideas?
> The permissions are set wide open.

I think you're missing the distinction between filesystem-based
references and document root-based references. If you load a file into
the browser (File.. Open.. - not via a webserver) then any references in
the file to jpgs or gifs or other files are taken relative to the
filesystem.  However, if you go through a webserver, the references are
taken relative to the docroot.

For example, if you have an images directory under the docroot
(/home/user/html/images), and you are in a parallel  sub-directory of
the docroot (/home/user/html/content), you can refer to an image as
follows:

Absolute refs:
via a webserver: src="/images/foo.gif"
file-based: src="/home/user/html/images/foo.gif"

relative refs:
via a webserver: src="../images/foo.gif"
file-based: src="../images/foo.gif"

So you can use relative links which are the same via a webserver or
file-based but which are not so portable (if you move your file up or
down the directory tree you have to change all the links). 

Or you can use absolute links - now the links work if you move the file
but you must always view the files via a webserver.

For any serious professional web-authoring, I would recommend absolute
links and always use a webserver - it is the only way to see what your
customers will see.

Rgds,

Owen Boyle.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org