Solved

Apache on Windows - Image Directory Outside of Root?

Posted on 2007-11-29
2
744 Views
Last Modified: 2013-12-13
Have a test server running Apache 2 on W2K SP4 with around 10,000 images in a web directory. The problem is when I do my daily backup I am also copying these image files, which are static and really need backed up maybe once a month.

So I was wondering, is it possible for the image directory to reside outside of the apache root, or even better, outside the apache directory altogether and still show when I'm viewing the test site locally?

This way I could easily backup the apache folder each day, without backing up the thousands of images.

And if so, how would I do it? I'm assuming it isn't as simple as just calling the full path to each image in my php code.
0
Comment
Question by:formadmirer
  • 2
2 Comments
 
LVL 25

Expert Comment

by:imitchie
ID: 20379631
The way to do it is to make the Image path a virtual directory in httpd.conf, and then for the PHP code to redirect to it using relative address
0
 
LVL 25

Accepted Solution

by:
imitchie earned 250 total points
ID: 20379635
for example

Alias /images/ "C:/notbackedup/images/"

so in your PHP code, you reference the images using

/images/imagename.gif
/images/sub1/imagename.gif

which apache will look for in the C:/notbackedup/images/ directory
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now