#
# SiteBuilder configuration file
#

#NameVirtualHost __hostip__:__port__ 
Listen	__port__

<VirtualHost __hostip__:__port__ 127.0.0.1:__port__>

    DocumentRoot __sitebuilder_path__
    ServerName __vhostname__
    ErrorLog __error_log__
    DirectoryIndex index.php index.html
    AddDefaultCharset UTF-8

    AddHandler application/x-httpd-php5 .php
    ScriptAlias /bin __php_path__
#SetEnv PHPRC __phprc_path__

    Action application/x-httpd-php5 /bin/__php__
	
__ssl__

    <Files *.js.gz>
        AddType "text/javascript" .gz
        AddEncoding gzip .gz
    </Files>

    <Files *.css.gz>
        AddType "text/css" .gz
        AddEncoding gzip .gz
    </Files>

    <Directory __sitebuilder_path__>
        Options +ExecCGI +FollowSymLinks
        Options -Indexes
        AllowOverride All
        Allow from all
    </Directory>
    
    <Directory __sitebuilder_path__/ServiceFacade>
        AddHandler application/x-httpd-php5 .asmx
    </Directory>
        
    <Directory __sitebuilder_path__/sites/*/*/attachments>
        Options -ExecCGI
        RemoveHandler .php
        AllowOverride None
    </Directory>
    
    <Directory __sitebuilder_path__/sites/*/*/__preview/attachments>
        Options -ExecCGI
        RemoveHandler .php
        AllowOverride None
    </Directory>
    
    <Directory __sitebuilder_path__/sites/*/*/__edit/attachments>
        Options -ExecCGI
        RemoveHandler .php
        AllowOverride None
    </Directory>
    
    <Directory __php_path__>
        Options +ExecCGI +FollowSymLinks
        Order allow,deny
        Allow from all
        AllowOverride None
    </Directory>
    
    <IfModule mod_rewrite.c>
        <Directory __sitebuilder_path__>
            RewriteEngine on
            RewriteCond %{REQUEST_URI}            ^/server-status$ [OR]
            RewriteCond %{REQUEST_URI}            ^/server-info$ [OR]
            RewriteCond %{REQUEST_URI}            ^/whm-server-status$
            RewriteRule (.*)                      - [L]            
            RewriteRule ^$                        index.php  [L]
			RewriteRule ^sso_endpoint.php/ui$     index.php/SSO/UI [L]
			RewriteRule ^sso_endpoint.php/SAML$   index.php/SSO/Proxy [L]
			RewriteRule ^sso_endpoint.php/signout$   index.php/SSO/Proxy [L]
            RewriteCond %{REQUEST_URI}            ^/[a-z]+/.*$
            RewriteCond %{REQUEST_URI}            [^/]$
            RewriteRule (.*)                      -  [L]
            RewriteCond %{REQUEST_FILENAME}       !-f
            RewriteCond %{REQUEST_FILENAME}       !-d
            RewriteRule (.*)                      index.php/$1  [QSA,L]
        </Directory>
    </IfModule>

</VirtualHost>
