mod_rewrite and .htaccess with catalogs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Nuzhser
Forum Newbie
Posts: 2
Joined: Mon Jun 07, 2010 10:16 am

mod_rewrite and .htaccess with catalogs

Post by Nuzhser »

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]
#...
Post Reply