Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two websites hosted on one server. The rootpath is:

  1. /public_html
  2. /public_html/2ndsite

I have uploaded the files of 2nd site to /public_html/2ndsite. It is working.

Now, I have a images folder(thousands of images) at public_html/images. I want to make this folder available at /public_html/2ndsite. I have tried "../images/image.gif", but doesn't work.

Whenever a image is inserted in first site, I would like to have that inserted in 2nd site also. Can I access the 1st site images in 2nd site withut using the URL (like as the image url shuld be "../images/image.gif" (images are inserted in 2nd site also, so in database I am storing this format.)

share|improve this question
Please add a tag saying what web server you mean - it looks like Apache, but you'll need to explicitly say this before you get meaningful responses. Also edit your message title to say it too. – 21st Century Moose Dec 13 '09 at 19:21
How are you using these images? with a server side executable (PHP, ASP, Python, Rails, etc.) or with a web browser? – Richard Slater Dec 13 '09 at 19:30

I'm going to attempt to interpret your question from your stream of consciousness:

"I have two websites hosted on one server. I want them to have separate content directories except for /images which should be shared between the two domains."

What you should do is:

  1. Put the content for into .../public_html/
  2. Put the content for into .../public_html/
  3. Put the images into .../public_html/common_images

Then, create a symlink from .../public_html/ and .../public_html/ to .../public_html/common_images.

Now, whenever you access, you'll be served content out of the .../public_html/common_images directory.

Make sure that you tell your webserver to allow symlinks and content to be served from .../public_html/common_images.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.