mod_rewrite and .htaccess with catalogs
Posted: Fri Jul 09, 2010 10:45 am
I have a catalog /images and this path is used in a script. I need to redirect script to search files in inner catalogs - /images1
/images2 etc. I have such .htaccess but it doesnt work. Help.
RewriteEngine On
RewriteOptions Inherit
RewriteBase /
RewriteCond %{REQUEST_URI} !^images/ [S=5]
# skip next 5 rules (number of lines following, i.e. 2*NDIR+1, where NDIR is number of imgdirs)
RewriteCond %{REQUEST_URI} ^images/(.*)$
RewriteCond imgdir1/%1 !-f [S=1]
RewriteRule .* imgdir1/%1 [L]
RewriteCond imgdir2/%1 !-f [S=1]
RewriteRule .* imgdir2/%1 [L]
#...
/images2 etc. I have such .htaccess but it doesnt work. Help.
RewriteEngine On
RewriteOptions Inherit
RewriteBase /
RewriteCond %{REQUEST_URI} !^images/ [S=5]
# skip next 5 rules (number of lines following, i.e. 2*NDIR+1, where NDIR is number of imgdirs)
RewriteCond %{REQUEST_URI} ^images/(.*)$
RewriteCond imgdir1/%1 !-f [S=1]
RewriteRule .* imgdir1/%1 [L]
RewriteCond imgdir2/%1 !-f [S=1]
RewriteRule .* imgdir2/%1 [L]
#...