/[drupal]/drupal/.htaccess
ViewVC logotype

Contents of /drupal/.htaccess

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.104 - (show annotations) (download)
Sun Aug 16 12:10:36 2009 UTC (3 months, 1 week ago) by dries
Branch: MAIN
CVS Tags: DRUPAL-7-0-UNSTABLE-9, DRUPAL-7-0-UNSTABLE-10, HEAD
Changes since 1.103: +8 -4 lines
- Patch #550488 by c960657: turn of mod_expires for all .php files.
1 #
2 # Apache/PHP/Drupal settings:
3 #
4
5 # Protect files and directories from prying eyes.
6 <FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
7 Order allow,deny
8 </FilesMatch>
9
10 # Don't show directory listings for URLs which map to a directory.
11 Options -Indexes
12
13 # Follow symbolic links in this directory.
14 Options +FollowSymLinks
15
16 # Make Drupal handle any 404 errors.
17 ErrorDocument 404 /index.php
18
19 # Force simple error message for requests for non-existent favicon.ico.
20 <Files favicon.ico>
21 # There is no end quote below, for compatibility with Apache 1.3.
22 ErrorDocument 404 "The requested file favicon.ico was not found.
23 </Files>
24
25 # Set the default handler.
26 DirectoryIndex index.php index.html index.htm
27
28 # Override PHP settings that cannot be changed at runtime. See
29 # sites/default/default.settings.php and drupal_initialize_variables() in
30 # includes/bootstrap.inc for settings that can be changed at runtime.
31
32 # PHP 5, Apache 1 and 2.
33 <IfModule mod_php5.c>
34 php_flag magic_quotes_gpc off
35 php_flag magic_quotes_sybase off
36 php_flag register_globals off
37 php_flag session.auto_start off
38 php_value mbstring.http_input pass
39 php_value mbstring.http_output pass
40 php_flag mbstring.encoding_translation off
41 </IfModule>
42
43 # Requires mod_expires to be enabled.
44 <IfModule mod_expires.c>
45 # Enable expirations.
46 ExpiresActive On
47
48 # Cache all files for 2 weeks after access (A).
49 ExpiresDefault A1209600
50
51 <FilesMatch \.php$>
52 # Do not allow PHP scripts to be cached unless they explicitly send cache
53 # headers themselves. Otherwise all scripts would have to overwrite the
54 # headers set by mod_expires if they want another caching behavior. This may
55 # fail if an error occurs early in the bootstrap process, and it may cause
56 # problems if a non-Drupal PHP file is installed in a subdirectory.
57 ExpiresActive Off
58 </FilesMatch>
59 </IfModule>
60
61 # Various rewrite rules.
62 <IfModule mod_rewrite.c>
63 RewriteEngine on
64
65 # If your site can be accessed both with and without the 'www.' prefix, you
66 # can use one of the following settings to redirect users to your preferred
67 # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
68 #
69 # To redirect all users to access the site WITH the 'www.' prefix,
70 # (http://example.com/... will be redirected to http://www.example.com/...)
71 # uncomment the following:
72 # RewriteCond %{HTTP_HOST} !^www\. [NC]
73 # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
74 #
75 # To redirect all users to access the site WITHOUT the 'www.' prefix,
76 # (http://www.example.com/... will be redirected to http://example.com/...)
77 # uncomment the following:
78 # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
79 # RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]
80
81 # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
82 # VirtualDocumentRoot and the rewrite rules are not working properly.
83 # For example if your site is at http://example.com/drupal uncomment and
84 # modify the following line:
85 # RewriteBase /drupal
86 #
87 # If your site is running in a VirtualDocumentRoot at http://example.com/,
88 # uncomment the following line:
89 # RewriteBase /
90
91 # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
92 RewriteCond %{REQUEST_FILENAME} !-f
93 RewriteCond %{REQUEST_FILENAME} !-d
94 RewriteCond %{REQUEST_URI} !=/favicon.ico
95 RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
96 </IfModule>
97
98 # $Id: .htaccess,v 1.103 2009/06/21 10:48:06 dries Exp $

  ViewVC Help
Powered by ViewVC 1.1.2