.htaccess 1.72 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>

11 12 13
# Deny directory listings:
Options -Indexes

14 15 16 17 18 19
# Customized server error messages:
ErrorDocument 400 /error.php
ErrorDocument 402 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
20

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

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

Dries's avatar
 
Dries committed
42
  # Rewrite old-style URLS of the form 'node.php?id=x':
Dries's avatar
 
Dries committed
43 44 45 46
  #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
47

Dries's avatar
 
Dries committed
48
  # Rewrite old-style URLs of the form 'module.php?mod=x':
Dries's avatar
 
Dries committed
49 50 51 52 53
  #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
54
  # Rewrite URLs of the form 'index.php?q=x':
Dries's avatar
 
Dries committed
55 56
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
Dries's avatar
 
Dries committed
57
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
58 59 60
</IfModule>

# $Id$