i have a script that uploads images, creates a hash for it, creates 3 directories, and stores the image to
imgs/f3s/v5g/234/536_f3sv5g2344270fd093ee8a9bf8de3de32dad.jpg
(the “536_” is the user id)
so im trying to turn
imgs/f3s/v5g/234/536_f3sv5g2344270fd093ee8a9bf8de3de32dad.jpg
into
user_pics/536/536_f3sv5g2344270fd093ee8a9bf8de3de32dad.jpg
how can i do that? i want that if someone wants to view the photo, they see the new directory in the url, not the one with 3 sub directories.
EDIT
So jon's method works but but i need to add RewriteRule .* index.php/$1 [PT,L]
to my htaccess. when i add that, everything stops working how come?
this is what i currently have so far
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]
RewriteRule ^user_pics/([^/]+)/[^]+(.{3})(.{3})(.{3})(.*).(jpe?g|gif|png)$ /imgs/$2/$3/$4/$1_$2$3$4$5.$6 [L]