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

Dries's avatar
 
Dries committed
18 19
# Overload PHP variables:
<IfModule mod_php4.c>
Dries's avatar
 
Dries committed
20 21
   # If you are using Apache 2, you have to use <IfModule sapi_apache2.c>
   # instead of <IfModule mod_php4.c>.
22
   php_value register_globals        0
23
   php_value track_vars              1
Dries's avatar
 
Dries committed
24
   php_value short_open_tag          1
25
   php_value magic_quotes_gpc        0
26 27
   php_value magic_quotes_runtime    0
   php_value magic_quotes_sybase     0
Dries's avatar
 
Dries committed
28
   php_value arg_separator.output    "&amp;"
natrak's avatar
natrak committed
29
   php_value session.cache_expire    200000
Dries's avatar
 
Dries committed
30
   php_value session.gc_maxlifetime  200000
natrak's avatar
natrak committed
31
   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
Dries's avatar
 
Dries committed
35
   php_value allow_call_time_pass_reference  On
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 43
  # Modify the RewriteBase if you are using Drupal in a subdirectory and the
  # rewrite rules are not working properly:
Dries's avatar
Dries committed
44 45
  #RewriteBase /drupal

Dries's avatar
 
Dries committed
46
  # Rewrite old-style URLS of the form 'node.php?id=x':
Dries's avatar
 
Dries committed
47 48 49 50
  #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
51

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

# $Id$