mod_rewrite and .htaccess with catalogs

Discussion in 'PHP' started by Nuzhser, Jul 9, 2010.

  1. #1
    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]
    #...
     
    Nuzhser, Jul 9, 2010 IP