.htaccess 1.84 KB
Newer Older
1
#
Dries's avatar
 
Dries committed
2
# Apache/PHP/site settings:
3 4
#

Dries's avatar
 
Dries committed
5
# Protect files and directories from prying eyes:
6
<Files ~ "(\.(conf|inc|module|pl|sh|sql|theme)|Entries|Repositories|Root|scripts|updates)$">
Dries's avatar
 
Dries committed
7 8 9 10
  order deny,allow
  deny from all
</Files>

Dries's avatar
 
Dries committed
11
# Set some options
12
Options -Indexes
Dries's avatar
 
Dries committed
13 14 15 16
Options FollowSymLinks

# Set the default handler to index.php:
DirectoryIndex index.php
17

18 19 20 21 22 23
# Customized server error messages:
ErrorDocument 400 /error.php
ErrorDocument 402 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
24

Dries's avatar
 
Dries committed
25 26
# Overload PHP variables:
<IfModule mod_php4.c>
27
   php_value register_globals        0
28
   php_value track_vars              1
Dries's avatar
 
Dries committed
29
   php_value short_open_tag          1
30
   php_value magic_quotes_gpc        0
31 32
   php_value magic_quotes_runtime    0
   php_value magic_quotes_sybase     0
Dries's avatar
 
Dries committed
33
   php_value arg_separator.output    "&amp;"
natrak's avatar
natrak committed
34
   php_value session.cache_expire    200000
Dries's avatar
 
Dries committed
35
   php_value session.gc_maxlifetime  200000
natrak's avatar
natrak committed
36
   php_value session.cookie_lifetime 2000000
Dries's avatar
 
Dries committed
37
   php_value session.auto_start      0
Dries's avatar
 
Dries committed
38
   php_value session.save_handler    user
Dries's avatar
 
Dries committed
39
   php_value session.cache_limiter   none
Dries's avatar
 
Dries committed
40
   php_value allow_call_time_pass_reference  On
Dries's avatar
 
Dries committed
41
</IfModule>
42 43 44 45

# Various rewrite rules
<IfModule mod_rewrite.c>
  RewriteEngine on
Dries's avatar
 
Dries committed
46

Dries's avatar
 
Dries committed
47
  # Rewrite old-style URLS of the form 'node.php?id=x':
Dries's avatar
 
Dries committed
48 49 50 51
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  #RewriteRule node.php index.php?q=node/view/%1 [L]
Dries's avatar
 
Dries committed
52

Dries's avatar
 
Dries committed
53
  # Rewrite old-style URLs of the form 'module.php?mod=x':
Dries's avatar
 
Dries committed
54 55 56 57 58
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  #RewriteRule module.php index.php?q=%1 [L]

Dries's avatar
 
Dries committed
59
  # Rewrite URLs of the form 'index.php?q=x':
Dries's avatar
 
Dries committed
60 61
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
Dries's avatar
 
Dries committed
62
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
63 64 65
</IfModule>

# $Id$