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

5
# Protect files and directories from prying eyes.
6
<FilesMatch "(\.(engine|inc|install|module|sh|.*sql|theme|tpl|xtmpl)|code-style\.pl|Entries.*|Repository|Root)$">
7 8
  Order deny,allow
  Deny from all
9
</FilesMatch>
Dries's avatar
 
Dries committed
10

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 24
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1
Dries's avatar
 
Dries committed
25
<IfModule mod_php4.c>
26 27 28
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
Dries's avatar
 
Dries committed
29
</IfModule>
30

31
# PHP 4, Apache 2
32
<IfModule sapi_apache2.c>
33 34 35
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
36 37 38 39 40 41 42
</IfModule>

# PHP 5, Apache 1 and 2
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
43 44
</IfModule>

45
# Reduce the time dynamically generated pages are cache-able.
46 47 48 49
<IfModule mod_expires.c>
  ExpiresByType text/html A1
</IfModule>

50
# Various rewrite rules.
51 52
<IfModule mod_rewrite.c>
  RewriteEngine on
Dries's avatar
 
Dries committed
53

54
  # Modify the RewriteBase if you are using Drupal in a subdirectory and
55
  # the rewrite rules are not working properly.
Dries's avatar
Dries committed
56 57
  #RewriteBase /drupal

58
  # Rewrite old-style URLs of the form 'node.php?id=x'.
Dries's avatar
 
Dries committed
59 60 61 62
  #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
63

64
  # Rewrite old-style URLs of the form 'module.php?mod=x'.
Dries's avatar
 
Dries committed
65 66 67 68 69
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  #RewriteRule module.php index.php?q=%1 [L]

70
  # Rewrite current-style URLs of the form 'index.php?q=x'.
Dries's avatar
 
Dries committed
71 72
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
Dries's avatar
 
Dries committed
73
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
74 75 76
</IfModule>

# $Id$