.htaccess 2 KB
Newer Older
1
#
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|engine|xtmpl)|Entries|Repositories|Root|scripts|updates)$">
7 8 9 10
  order deny,allow
  deny from all
</Files>

11
# Set some options
12
Options -Indexes
13
Options +FollowSymLinks
14

15 16 17
# Customized server error messages:
ErrorDocument 404 /index.php

18 19
# Set the default handler to index.php:
DirectoryIndex index.php
20

21 22
# Overload PHP variables:
<IfModule mod_php4.c>
23 24
   # If you are using Apache 2, you have to use <IfModule sapi_apache2.c>
   # instead of <IfModule mod_php4.c>.
25
   php_value register_globals        0
26
   php_value track_vars              1
27
   php_value short_open_tag          1
28
   php_value magic_quotes_gpc        0
29 30
   php_value magic_quotes_runtime    0
   php_value magic_quotes_sybase     0
31
   php_value arg_separator.output    "&amp;"
32
   php_value session.cache_expire    200000
33
   php_value session.gc_maxlifetime  200000
34
   php_value session.cookie_lifetime 2000000
35
   php_value session.auto_start      0
36
   php_value session.save_handler    user
37
   php_value session.cache_limiter   none
38
   php_value allow_call_time_pass_reference  On
39
</IfModule>
40 41 42 43

# Various rewrite rules
<IfModule mod_rewrite.c>
  RewriteEngine on
44

45 46
  # Modify the RewriteBase if you are using Drupal in a subdirectory and the
  # rewrite rules are not working properly:
47 48
  #RewriteBase /drupal

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

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

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

# $Id$