I'm receiving from the client a request for a ".png" file. The request is by sending the full address (I cant change that).


   /var/www/imges/<file name> 

The problem from what I understand is that the apache server understands this:

 /var/www/imges/var/www/imges/<file name>

Because his root is at "/var/www/"/ So he can't find it.

I try to add the the ".conf" file an Alias Directive:

Alias /var/www/imges /images
<Directory /image>
   Order allow,deny
   Allow from all

But it doesn’t seem to do anything...

I will appreciate any advice.

migrated from stackoverflow.com Mar 29 '11 at 13:18

This question came from our site for professional and enthusiast programmers.

  • Use <LocationMatch > or a RewriteRule. With those you can achieve it easily. – 0xC0000022L Mar 29 '11 at 0:22

Just try something like:

 Alias /var/www/imges /var/www/imges

restart Apache and try loading an image like http://site/var/www/imges/image.jpg. If you get an error message the type of error will help you determine what is wrong. Also make sure your path name is spelled correctly (is it "imges" or "images").


It's the opposite way around:

Alias /images /path/to/images

All images under /path/to/images are then available since http://host/images/image.png.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy