.htaccess 2.07 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:
Dries's avatar
 
Dries committed
6
<Files ~ "(\.(conf|inc|module|pl|sh|sql|theme|engine|xtmpl)|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
13
Options +FollowSymLinks
Dries's avatar
 
Dries committed
14

Dries's avatar
 
Dries committed
15 16 17
# Customized server error messages:
ErrorDocument 404 /index.php

Dries's avatar
 
Dries committed
18
# Set the default handler to index.php:
Dries's avatar
Dries committed
19
DirectoryIndex index.php
20

Dries's avatar
 
Dries committed
21
# Overload PHP variables:
Dries's avatar
 
Dries committed
22 23
<IfModule mod_php4.c>
#<IfModule sapi_apache2.c>
Dries's avatar
 
Dries committed
24 25
   # If you are using Apache 2, you have to use <IfModule sapi_apache2.c>
   # instead of <IfModule mod_php4.c>.
26
   php_value register_globals        0
27
   php_value track_vars              1
Dries's avatar
 
Dries committed
28
   php_value short_open_tag          1
29
   php_value magic_quotes_gpc        0
30 31
   php_value magic_quotes_runtime    0
   php_value magic_quotes_sybase     0
Dries's avatar
 
Dries committed
32
   php_value arg_separator.output    "&amp;"
Dries's avatar
 
Dries committed
33
   php_value session.auto_start      0
Dries's avatar
 
Dries committed
34
   php_value allow_call_time_pass_reference  On
35 36
   # Session and site-specific PHP settings are applied
   # in /sites/default/settings.php
Dries's avatar
 
Dries committed
37
</IfModule>
38

39 40 41 42 43 44
# Overload mod_expires variables.
<IfModule mod_expires.c>
  # Reduce the time dynamically generated HTML pages are cache-able.
  ExpiresByType text/html A1
</IfModule>

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

Dries's avatar
 
Dries committed
49 50
  # Modify the RewriteBase if you are using Drupal in a subdirectory and the
  # rewrite rules are not working properly:
Dries's avatar
Dries committed
51 52
  #RewriteBase /drupal

Dries's avatar
 
Dries committed
53
  # Rewrite old-style URLS of the form 'node.php?id=x':
Dries's avatar
 
Dries committed
54 55 56 57
  #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
58

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

# $Id$