I've a credit card applicatoin which utilizes virtual sites through .htaccess:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^[a-z0-9]+/(.*)$ public/$1 [NC,L]

RedirectMatch Permanent ^/([a-z0-9]+)$ /$1/

The "public" directory is my real directory, which consists of the applying files (PHP + Zend Framework). For every of my clients, I wish to give a URL like system.example.com/CLIENTNAME. For this function, the configuration above works perfectly, however I have to redirect everything that's not really a existing filename to public/primary.php.

Presently I'm while using default .htaccess supplied by the framework around the "public" directory. However, things i want would be to configure all at one time.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ main.php [NC,L]

Does anybody understand how to do that?