pub-htaccess.txt
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
child 1 e2915a7cbdfa
permissions -rw-r--r--
RELEASE 4.2.0 freetown
     1 # Sample '.htaccess' file for 'pub' subdirectory
     2 
     3 # Controls access to TWiki 'pub' subdirectory - copy this into 'pub', 
     4 # naming it '.htaccess', to have Apache use it.
     5 
     6 # This is useful if you install TWiki 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.)
    10 
    11 # Allow all access
    12 Allow from all
    13 
    14 # Deny people from looking at the index
    15 # Bare in mind that this is largely inadequate
    16 # See http://twiki.org/cgi-bin/view/Codev/SecuringAttachments
    17 # and http://develop.twiki.org/~develop/cgi-bin/view/Bugs/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.
    20 Options None
    21 
    22 # We need to protect the entire pub directory tree against any kind of script execution
    23 # TWiki 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.
    26 
    27 # If you have PHP4 or PHP5 installed make sure the directive below is enabled
    28 # If you do not have PHP installed you will need to comment out the directory below
    29 # to avoid errors.
    30 php_flag engine off
    31 
    32 #If you have PHP3 installed make sure the directive below is enabled
    33 #php3_engine off
    34 
    35 # This line will redefine the mime type for the most common types of scripts
    36 AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
    37 
    38 #add an Expires header that is sufficiently in the future that the browser does not even ask if its uptodate
    39 # reducing the load on the server significantly
    40 #IF you can, you should enable this - it _will_ improve your twiki experience, even if you set it to under one day.
    41 #LoadModule expires_module libexec/httpd/mod_expires.so
    42 #AddModule mod_expires.c
    43 #<ifmodule mod_expires.c>
    44 #  <filesmatch "\.(jpg|gif|png|css|js)$">
    45 #       ExpiresActive on
    46 #       ExpiresDefault "access plus 11 days"
    47 #   </filesmatch>
    48 #</ifmodule>
    49 #Add ETags too
    50 FileETag MTime Size