# Sample '.htaccess' file for 'pub' subdirectory

# Controls access to Foswiki 'pub' subdirectory - copy this into 'pub', 
# naming it '.htaccess', to have Apache use it.

# This is useful if you install Foswiki on a web host, or an intranet host
# where you can't edit the Apache http.conf file.  If you can edit the
# http.conf file, just set the 'Allow from all' there (or locate these
# directories outside the Web-visible directory tree.)

# Allow all access
Allow from all

# Deny people from looking at the index
# Bear in mind that this is largely inadequate
# See http://foswiki.org/System/AccessControl#Controlling_access_to_Attachment
# and http://foswiki.org/Tasks/Item610
# If you think you have a solution it is in your best interests to share it 
# so others can test your idea.
# Caution:  If your directories are reached by SymLinks,  this option will
# result in 403 errors.  Replace it with    "Options FollowSymLinks"
Options FollowSymLinks

# We need to protect the entire pub directory tree against any kind of script execution
# Foswiki has a renaming protection scheme that alters certain file names to prevent
# script execution but it may not be 100% safe only to rely on this. The safest
# protection is to disabled all scripting.

# If you have PHP installed as Apache module, one of the below directives will ensure
# that it is disabled.   The "ifmodule" statements should prevent this from causing
# errors if php is not installed.

<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>

# This line will redefine the mime type for the most common types of scripts
AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi

#for TWikiCompatibility - or even to make 'attachment not found's more user friendly
# - This statement must be tailored with the {ScriptUrlPath}.  See
# bin-htaccess-advanced.txt for details.
# ErrorDocument 404 /foswiki/bin/viewfile

#add an Expires header that is sufficiently in the future that the browser does not even ask if its uptodate
# reducing the load on the server significantly
#IF you can, you should enable this - it _will_ improve your foswiki experience, even if you set it to under one day.
#LoadModule expires_module libexec/httpd/mod_expires.so
#AddModule mod_expires.c
#<ifmodule mod_expires.c>
#  <filesmatch "\.(jpe?g|gif|png|ico|css|js)$">
#       ExpiresActive on
#       ExpiresDefault "access plus 11 days"
#   </filesmatch>
#</ifmodule>
#Add ETags too
FileETag MTime Size
