I am currently having some problems seperating the cgi-bin from the rest of the sites content on a subdomain
I am currently using a modifered version of the 'Using a separate virtual host configuration file' example the rules i am using are below (these are all on one line in the config)
RewriteEngine on
RewriteMap lowercase int:tolower
# define the map file
RewriteMap vhost txt:/home/www/conf/vhost.map
# deal with aliases as above
RewriteCond %{REQUEST_URI} !^/icons/
RewriteCond %{REQUEST_URI} !^/cgi-bin/
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$
# this does the file-based remap
RewriteCond ${vhost:%1} ^(/.*)$
RewriteRule ^/(.*)$ %1/$1
RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$
RewriteCond ${vhost:%1} ^(/.*)$
RewriteRule ^/(.*)$ %1/$1
with vhost.map containing
http://www.domain.com /home/www/domain.com/
sub.domain.com /home/www/domain.com/public_html/sub
Predictable for cgi-bins on sub.domain.com it adds cgi-bin onto the above path however i would prefer if it went to /home/www/domain.com/cgi-bin/sub (or whatever the subdomain name might be) or is it wrong way to approach this sort of thing?
Finally is it possible to use User and Group with mod_rewrite or would another solution have to found for running cgi's securely?