
ScriptAlias /bin "/var/www/foswiki/bin"

Alias /pub "/var/www/foswiki/pub"

<VirtualHost *:80>
	UseCanonicalName Off
	ServerAdmin  webmaster@localhost
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>

<VirtualHost *:443>
	SSLEngine on
	ServerAdmin  webmaster@localhost
</VirtualHost>

RedirectMatch ^/$ /bin/view

<Directory "/var/www/foswiki">
    Order Allow,Deny
    Allow from all
    Deny from env=blockAccess
</Directory>

Alias /foswiki "/var/www/foswiki"

BrowserMatchNoCase ^$ blockAccess

<Directory "/var/www/foswiki/bin">
    AllowOverride None
    Order Allow,Deny
    Allow from all
    Deny from env=blockAccess

    Options ExecCGI FollowSymLinks
    SetHandler cgi-script

    ErrorDocument 401 /bin/view/System/UserRegistration

</Directory>

<Directory "/var/www/foswiki/pub">
    Options None
    AllowOverride None
    Order Allow,Deny
    Allow from all
    Deny from env=blockAccess


    <ifmodule mod_php3.c>
        php3_engine off
    </ifmodule>
    <ifmodule mod_php4.c>
        php_admin_flag engine off
    </ifmodule>
    <ifmodule mod_php5.c>
        php_admin_flag engine off
    </ifmodule>

    AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi

    ErrorDocument 404 /bin/viewfile
</Directory>

<Directory "/var/www/foswiki/pub/Trash">
	deny from all
</Directory>

<Directory "/var/www/foswiki/data">
    deny from all
</Directory>

<Directory "/var/www/foswiki/templates">
    deny from all
</Directory>

<Directory "/var/www/foswiki/lib">
    deny from all
</Directory>

<Directory "/var/www/foswiki/locale">
    deny from all
</Directory>

<Directory "/var/www/foswiki/tools">
    deny from all
</Directory>

<Directory "/var/www/foswiki/working">
    deny from all
</Directory>
