1
# Sample '.htaccess' file for 'pub' subdirectory
3
# Controls access to Foswiki 'pub' subdirectory - copy this into 'pub',
4
# naming it '.htaccess', to have Apache use it.
6
# This is useful if you install Foswiki on a web host, or an intranet host
7
# where you can't edit the Apache http.conf file. If you can edit the
8
# http.conf file, just set the 'Allow from all' there (or locate these
9
# directories outside the Web-visible directory tree.)
14
# Deny people from looking at the index
15
# Bare in mind that this is largely inadequate
16
# See http://foswiki.org/System/AccessControl#Controlling_access_to_Attachment
17
# and http://foswiki.org/Tasks/Item610
18
# If you think you have a solution it is in your best interests to share it
19
# so others can test your idea.
22
# We need to protect the entire pub directory tree against any kind of script execution
23
# Foswiki has a renaming protection scheme that alters certain file names to prevent
24
# script execution but it may not be 100% safe only to rely on this. The safest
25
# protection is to disabled all scripting.
27
# If you have PHP4 or PHP5 installed as Apache module make sure the directive below is enabled
28
# If you do not have PHP installed you will need to comment out the directory below
30
# If PHP is installed as CGI this flag is not needed and will in fact make Apache fail
33
# If you have PHP3 installed as Apache module make sure the directive below is enabled
34
# If PHP is installed as CGI this flag is not needed and will in fact make Apache fail
37
# This line will redefine the mime type for the most common types of scripts
38
AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
40
#for TWikiCompatibility - or even to make 'attachment not found's more user friendly
41
ErrorDocument 404 /foswiki/bin/viewfile
43
#add an Expires header that is sufficiently in the future that the browser does not even ask if its uptodate
44
# reducing the load on the server significantly
45
#IF you can, you should enable this - it _will_ improve your foswiki experience, even if you set it to under one day.
46
#LoadModule expires_module libexec/httpd/mod_expires.so
47
#AddModule mod_expires.c
48
#<ifmodule mod_expires.c>
49
# <filesmatch "\.(jpg|gif|png|css|js)$">
51
# ExpiresDefault "access plus 11 days"