028254c782e49b696e540cbd7b20956cb065f741
[plewww.git] / httpd / plewww.conf
1 #
2 # Apache/PHP/Drupal settings:
3 #
4
5 <Directory /var/www/html>
6
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)$">
9   Order deny,allow
10   Deny from all
11 </FilesMatch>
12
13 # Set some options.
14 Options -Indexes
15 Options +FollowSymLinks
16
17 # Customized error messages.
18 ErrorDocument 404 index.php
19
20 # Set the default handler.
21 DirectoryIndex index.php
22
23 # Override PHP settings. More in sites/default/settings.php
24 # but the following cannot be changed at runtime.
25
26 # PHP 4, Apache 1
27 <IfModule mod_php4.c>
28   php_value magic_quotes_gpc                0
29   php_value register_globals                0
30   php_value session.auto_start              0
31 </IfModule>
32
33 # PHP 4, Apache 2
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
38 </IfModule>
39
40 # PHP 5, Apache 1 and 2
41 <IfModule mod_php5.c>
42   php_value magic_quotes_gpc                0
43   php_value register_globals                0
44   php_value session.auto_start              0
45 </IfModule>
46
47 # Reduce the time dynamically generated pages are cache-able.
48 # note: drupal's bootstrap.inc does: header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
49 # so forget about optimizing php content
50 ExpiresActive On
51 <FilesMatch "\.(css|js|png|gif|jpg)$">
52 ExpiresDefault "access plus 12 hours"
53 </FilesMatch>
54
55 # Turn on gzip compression
56 <FilesMatch "\.(php|js|css)$">
57 SetOutputFilter DEFLATE
58 </FilesMatch>
59
60 # Various rewrite rules.
61 <IfModule mod_rewrite.c>
62   RewriteEngine on
63
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:
66   #
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]
70   #
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]
74
75
76   # Modify the RewriteBase if you are using Drupal in a subdirectory and
77   # the rewrite rules are not working properly.
78   # RewriteBase /drupal
79
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]
85
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]
91
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]
96 </IfModule>
97
98 </Directory>
99
100 # $Id$