.htaccess 1.9 KB
Newer Older
1
#
2
# Apache/PHP/Drupal settings:
3 4
#

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

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

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

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

21 22 23
# Override PHP settings. More exist in sites/default/settings.php, but
# the following cannot be changed at runtime. The first IfModule is
# for Apache 1.3, the second for Apache 2.
Dries's avatar
 
Dries committed
24
<IfModule mod_php4.c>
25 26 27
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
Dries's avatar
 
Dries committed
28
</IfModule>
29

30
<IfModule sapi_apache2.c>
31 32 33
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
34 35
</IfModule>

36
# Reduce the time dynamically generated pages are cache-able.
37 38 39 40
<IfModule mod_expires.c>
  ExpiresByType text/html A1
</IfModule>

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

45
  # Modify the RewriteBase if you are using Drupal in a subdirectory and
46
  # the rewrite rules are not working properly.
Dries's avatar
Dries committed
47 48
  #RewriteBase /drupal

49
  # Rewrite old-style URLs of the form 'node.php?id=x'.
Dries's avatar
 
Dries committed
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]
Dries's avatar
 
Dries committed
54

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

# $Id$