views:

46

answers:

1

Is it possible?

Let's say my directory structure looks like this:

/data
    /data/images
/public

The document root is in the "public" directory. This won't work, of course:

<img src="/../data/images/1.png" alt="" />

But maybe it's possible to enable serving images from directory above document root somehow? I would like to know.

+4  A: 

The most common way is an Alias:

Alias /data/ /wherever/your/data/are/
unbeli
+1 this needs to be put into `httpd.conf` itself, though, it won't work in a `.htaccess` file.
Pekka
+1, i used this method to to try and keep as many document out of the public_html for security.
RobertPitt
@Robert umm, how would that add any security?
Gordon
I ment securty as i store my execution file such as php outside the html root scope and include from a directory root, I would not be worried about public files such as js, just saying that its better to generally store files outside the public root. - php files are safe from injection attempts and out of public's way.
RobertPitt