img src in webspeed

Posted by anandknr on 29-Jul-2011 23:05

Hi all,

I have an issue with image tag in html page.

In my project there are two folders, html and img .
html folder contains the html files and img folder contains the images.

I have a home.html and the only html tag it contains is <img src="../img/home.jpg"> and the img folder contains this home.jpg .

when i open it locally in a browser (right click open with IE) everything ok....home.jpg is showing.

Now, i compiled the home.html without any errors and when run from the server image home.jpg is not showing.


As my senior said i put the home.jpg in the folder /var/www/html/images ...now its showing when run from the server.
But i want to put  home.jpg in my application folder(img folder) not in apache folder.

How could i do this...please help

All Replies

Posted by Admin on 30-Jul-2011 00:01

Refer to the Apache Documentation and configure a virtual directory for the images pointing to something in your src folder structure. Or use an UNIX symbolic link (ln).

But make sure nobody can load your source code using that way, your senior would not appreciate that.

Posted by Admin on 30-Jul-2011 00:49

mikefe wrote:

Refer to the Apache Documentation and configure a virtual directory for the images pointing to something in your src folder structure. Or use an UNIX symbolic link (ln).

That could help of course but I think this is more related to deployment than development and I somehow have the feeling that this should be of no concern for Anand

What he needs to know is that he can't reference static content (images) from dynamic pages using path relative to current page (from the post on progresstalk, ../img/logo.img), there must be somewhere a configuration variable pointing to the application static content folder and from that point he can reference anything static like images/movies/flash/documents/whatever.

This thread is closed