Solved

Apache on Windows - Image Directory Outside of Root?

Posted on 2007-11-29
2
750 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

839 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