httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fábio Jr." <>
Subject [users@httpd] Redirecting URLs and directory structure
Date Wed, 07 Oct 2009 13:29:11 GMT

I have a server that serves static content, and most of it are images. 
These images are all stored in a directory, and there are about 4 
million images in this directory.

I believe that this storage structure is, in the medium term, unsafe and 
not dynamic, making scalability and backup virtually impossible via the 
network, mainly because the server is hosted in another country.

Thinking of a way to solve this problem, I got a chance, but that may 
not be the right solution. My suggestion is as follows:

Divide these images in directories based on the last 3 numbers of the 
file name. (The files are named in ascending order in the format 


The absolute path of the file 123891.png on the server is  / 
imagens/8/91/123891.png. The file 456891.png also be in the same folder. 
However the file 123456.png will be stored in the / 

The structure is always based on the hundreds of file name (891), and 
the number of the hundred (8) is the parent folder, and the numbers of 
ten and unity (91) are the name of the child.

1st question: is there a way of making a request to, Apache will redirect or treat 
this URL for the correct path through a regular expression?

2nd question: I would like suggestions on how to better structure the 
files for better performance. Other possible solutions would be to 
create even more specific directories or the migration to a distributed 
storage service.


    Fábio Jr.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message