<VirtualHost 127.0.0.1>
    ServerName eventcode
    ServerAdmin barbie@missbarbell.co.uk
    DocumentRoot /var/www/eventcode/html
    #RewriteLog "/var/www/logs/rewrite.log"
    #RewriteLogLevel 3
    RewriteEngine on
    RewriteRule ^/(favicon.*)$                  /$1 [PT]
    RewriteRule ^/(eventcode|images|css|js)/(.*)$  /$1/$2 [PT]
    RewriteRule ^/key/(.*?)/(\d+)$              /cgi-bin/pages.cgi?act=survey-login&code=$1&userid=$2 [PT,QSA]
    RewriteRule ^/survey/(\d+)$                 /cgi-bin/pages.cgi?act=survey-check&userid=$1 [PT]
    RewriteRule ^/course/(\d+)$                 /cgi-bin/pages.cgi?act=course-check&courseid=$1 [PT]
    RewriteRule ^/talk/(\d+)$                   /cgi-bin/pages.cgi?act=talk-check&courseid=$1 [PT]
    RewriteRule ^/submit/(talk|course|survey)$  /cgi-bin/pages.cgi?act=$1-submit [PT]
    RewriteRule ^/(admin|anno)/(.*)$            /cgi-bin/pages.cgi?act=$1-$2 [PT]
    RewriteRule ^/cgi-bin/pages.cgi$            /cgi-bin/pages.cgi [PT]
    RewriteRule ^.*$                            /cgi-bin/pages.cgi?act=home-main [PT,QSA]
    ScriptAlias /cgi-bin/pages.cgi              /var/www/eventcode/cgi-bin/eventcode.cgi
    ScriptAlias /cgi-bin/                       /var/www/eventcode/cgi-bin/
    Options +ExecCGI
    ErrorLog /var/www/logs/eventcode-error.log
    CustomLog /var/www/logs/eventcode-access.log common
</VirtualHost>
