Sunday, 15 August 2010

regex - Redirect all subfolders but keep files accessible? -



regex - Redirect all subfolders but keep files accessible? -

i have website public folder in host images.

let's root folder "public". in folder have folder called "images". in folder called "images" have lots of folders called "1"... "92345678".

i want create htaccess rule redirect users folders:

www.website.com/public/images/ www.website.com/public/images/1 www.website.com/public/images/2 ... www.website.com/public/images/10000001

to

www.website.com/public/

please give me alternative work sub folders. (recursive)

i want redirect folders, images urls should work!

you can utilize rule in /public/images/.htaccess file:

rewriteengine on rewritebase /public/images/ rewritecond %{request_filename} -d rewriterule . /public/ [l,r=302]

regex apache .htaccess preg-match

No comments:

Post a Comment