# Configuration sample send by Ian Charles <ian@ids.org.au>.
# The following Apache configuration directives denies public listing
# or accessing scripts that are in a user's cgi-bin directory.

<Directory /home/*/public_html/cgi-bin/>
        AllowOverride AuthConfig
        Options -Indexes
        <Limit GET>
                Deny from all
        </Limit>
</Directory>


# The following Apache configuration directives transparently pass
# requests to a user's cgi-bin script through cgiwrap.

<IfModule mod_rewrite.c>
        RewriteEngine on

        # Uncomment if you don't want a particular user's cgi-bin to use cgiwrap
        # You'll need to handle this yourself though!
        # RewriteCond  %{REQUEST_URI} !^/~username/cgi-bin/(.*)

        # Rewrite requests for user's cgi-bin to cgiwrap.
        RewriteRule  ^/([^/]+)/cgi-bin/(.*)    /cgi-bin/cgiwrap/$1/$2 [PT]
        RewriteRule  ^/([^/]+)/cgi-bin-d/(.*)  /cgi-bin/cgiwrapd/$1/$2 [PT]
        RewriteRule  ^/([^/]+)/nph-bin-d/(.*)  /cgi-bin/nph-cgiwrapd/$1/$2 [PT]
        RewriteRule  ^/([^/]+)/nph-bin/(.*)    /cgi-bin/nph-cgiwrap/$1/$2 [PT]

</IfModule>

