I've the list below of Web addresses to rewrite:

1 write url
/items/client/

send to
/basedir/system/index.php?client=cliente

2 write url
/product/client/index.php

send to
/basedir/system/index.php?client=cliente

3 write url
/items/client/image/dir2/myimage.digital

send to
/basedir/system/image/client/dir2/myimage.digital

4 write url
/items/client/image/dir2/more_x_dir/other.img

send to
/basedir/system/image/client/dir2/more_x_dir/other.img

With one of these rules I've pretty much solved the points 1 and a pair of:

 RewriteEngine On

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d

 RewriteRule ^product/([a-zA-Z]+)$ /basedir/system/index.php?client=base=$1 [L,QSA]
 RewriteRule ^product/([a-zA-Z]+)/$ /basedir/system/index.php?client=base=$1 [L,QSA]
 RewriteRule ^product/([a-zA-Z]+)/(.*)$ /basedir/system/index.php?client=$1 [L,QSA]

My issue is in the event 3 and 4 after i have files with css / image's / js. as well as after i have numerous sites, it might be that within the situation of numerous sites need to make a guide for everybody, but I don't understand how.

thanks greatly

Edit

my solution in line with the answer recognized:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^product/([a-zA-Z]+)/(.*)\.(gif|jpg|ico|css|js|txt|zip|xls|doc)$ /basedir/system/$2.$3 [L,QSA]
RewriteRule ^product/([a-zA-Z]+)$ /basedir/system/index.php?database=$1 [L,QSA]
RewriteRule ^product/([a-zA-Z]+)/$ /basedir/system/index.php?database=$1 [L,QSA]
RewriteRule ^product/([a-zA-Z]+)/index.php$ /basedir/system/index.php?database=$1 [L,QSA]
RewriteRule ^product/([a-zA-Z]+)/(.*)$ /basedir/system/$2?database=$1 [L,QSA]

In my opinion that for you to do something similar to the next, according to your description (I am still just a little unclear about the guidelines that you simply presently have). I additionally result in the assumption you had folders named image, css, and js for every client.

RewriteEngine On

# Rewrite images/css/js to their real files
RewriteRule ^products/([^/]+)/(image|css|js)/(.*)$ /basedir/system/$2/$1/$3 [L]

# Rewrite everything else to the index.php script
RewriteRule ^products/([^/]+)(/.+)?$ /basedir/system/index.php?client=$1 [QSA,L]