2 # Apache/PHP/Drupal settings:
5 <Directory /var/www/html>
7 # Protect files and directories from prying eyes.
8 <FilesMatch "(\.(engine|inc|install|module|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root)$">
15 Options +FollowSymLinks
17 # Customized error messages.
18 ErrorDocument 404 index.php
20 # Set the default handler.
21 DirectoryIndex index.php
23 # Override PHP settings. More in sites/default/settings.php
24 # but the following cannot be changed at runtime.
28 php_value magic_quotes_gpc 0
29 php_value register_globals 0
30 php_value session.auto_start 0
34 <IfModule sapi_apache2.c>
35 php_value magic_quotes_gpc 0
36 php_value register_globals 0
37 php_value session.auto_start 0
40 # PHP 5, Apache 1 and 2
42 php_value magic_quotes_gpc 0
43 php_value register_globals 0
44 php_value session.auto_start 0
47 # Reduce the time dynamically generated pages are cache-able.
48 # note: drupal's botstrap.inc does: header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
49 # so forget about optimizing php content
51 <FilesMatch "\.(css|js|png|gif|jpg)$">
52 ExpiresDefault "access plus 12 hours"
55 # Turn on gzip compression
56 <FilesMatch "\.(php|js|css)$">
57 SetOutputFilter DEFLATE
60 # Various rewrite rules.
61 <IfModule mod_rewrite.c>
64 # If your site can be accessed both with and without the prefix www.
65 # you can use one of the following settings to force user to use only one option:
67 # If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
68 # RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
69 # RewriteRule .* http://www.example.com/ [L,R=301]
71 # If you want the site to be accessed only WITHOUT the www. , adapt and uncomment the following:
72 # RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
73 # RewriteRule .* http://example.com/ [L,R=301]
76 # Modify the RewriteBase if you are using Drupal in a subdirectory and
77 # the rewrite rules are not working properly.
80 # Rewrite old-style URLs of the form 'node.php?id=x'.
81 #RewriteCond %{REQUEST_FILENAME} !-f
82 #RewriteCond %{REQUEST_FILENAME} !-d
83 #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
84 #RewriteRule node.php index.php?q=node/view/%1 [L]
86 # Rewrite old-style URLs of the form 'module.php?mod=x'.
87 #RewriteCond %{REQUEST_FILENAME} !-f
88 #RewriteCond %{REQUEST_FILENAME} !-d
89 #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
90 #RewriteRule module.php index.php?q=%1 [L]
92 # Rewrite current-style URLs of the form 'index.php?q=x'.
93 RewriteCond %{REQUEST_FILENAME} !-f
94 RewriteCond %{REQUEST_FILENAME} !-d
95 RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]