annotate .htaccess @ 20:e3d20ebd63d1 tip

Added tag 6.9 for changeset 3edae6ecd6c6
author Franck Deroche <franck@defr.org>
date Thu, 15 Jan 2009 10:16:10 +0100
parents 4347c45bb494
children
rev   line source
webmaster@1 1 #
webmaster@1 2 # Apache/PHP/Drupal settings:
webmaster@1 3 #
webmaster@1 4
webmaster@1 5 # Protect files and directories from prying eyes.
webmaster@15 6 <FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
webmaster@1 7 Order allow,deny
webmaster@1 8 </FilesMatch>
webmaster@1 9
webmaster@1 10 # Don't show directory listings for URLs which map to a directory.
webmaster@1 11 Options -Indexes
webmaster@1 12
webmaster@1 13 # Follow symbolic links in this directory.
webmaster@1 14 Options +FollowSymLinks
webmaster@1 15
webmaster@7 16 # Make Drupal handle any 404 errors.
webmaster@1 17 ErrorDocument 404 /index.php
webmaster@1 18
webmaster@7 19 # Force simple error message for requests for non-existent favicon.ico.
webmaster@7 20 <Files favicon.ico>
webmaster@15 21 # There is no end quote below, for compatibility with Apache 1.3.
webmaster@7 22 ErrorDocument 404 "The requested file favicon.ico was not found.
webmaster@7 23 </Files>
webmaster@7 24
webmaster@1 25 # Set the default handler.
webmaster@1 26 DirectoryIndex index.php
webmaster@1 27
webmaster@1 28 # Override PHP settings. More in sites/default/settings.php
webmaster@1 29 # but the following cannot be changed at runtime.
webmaster@1 30
webmaster@1 31 # PHP 4, Apache 1.
webmaster@1 32 <IfModule mod_php4.c>
webmaster@1 33 php_value magic_quotes_gpc 0
webmaster@1 34 php_value register_globals 0
webmaster@1 35 php_value session.auto_start 0
webmaster@1 36 php_value mbstring.http_input pass
webmaster@1 37 php_value mbstring.http_output pass
webmaster@1 38 php_value mbstring.encoding_translation 0
webmaster@1 39 </IfModule>
webmaster@1 40
webmaster@1 41 # PHP 4, Apache 2.
webmaster@1 42 <IfModule sapi_apache2.c>
webmaster@1 43 php_value magic_quotes_gpc 0
webmaster@1 44 php_value register_globals 0
webmaster@1 45 php_value session.auto_start 0
webmaster@1 46 php_value mbstring.http_input pass
webmaster@1 47 php_value mbstring.http_output pass
webmaster@1 48 php_value mbstring.encoding_translation 0
webmaster@1 49 </IfModule>
webmaster@1 50
webmaster@1 51 # PHP 5, Apache 1 and 2.
webmaster@1 52 <IfModule mod_php5.c>
webmaster@1 53 php_value magic_quotes_gpc 0
webmaster@1 54 php_value register_globals 0
webmaster@1 55 php_value session.auto_start 0
webmaster@1 56 php_value mbstring.http_input pass
webmaster@1 57 php_value mbstring.http_output pass
webmaster@1 58 php_value mbstring.encoding_translation 0
webmaster@1 59 </IfModule>
webmaster@1 60
webmaster@1 61 # Requires mod_expires to be enabled.
webmaster@1 62 <IfModule mod_expires.c>
webmaster@1 63 # Enable expirations.
webmaster@1 64 ExpiresActive On
webmaster@1 65
webmaster@1 66 # Cache all files for 2 weeks after access (A).
webmaster@1 67 ExpiresDefault A1209600
webmaster@1 68
webmaster@1 69 # Do not cache dynamically generated pages.
webmaster@1 70 ExpiresByType text/html A1
webmaster@1 71 </IfModule>
webmaster@1 72
webmaster@1 73 # Various rewrite rules.
webmaster@1 74 <IfModule mod_rewrite.c>
webmaster@1 75 RewriteEngine on
webmaster@1 76
webmaster@1 77 # If your site can be accessed both with and without the 'www.' prefix, you
webmaster@1 78 # can use one of the following settings to redirect users to your preferred
webmaster@1 79 # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
webmaster@1 80 #
webmaster@1 81 # To redirect all users to access the site WITH the 'www.' prefix,
webmaster@1 82 # (http://example.com/... will be redirected to http://www.example.com/...)
webmaster@1 83 # adapt and uncomment the following:
webmaster@1 84 # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
webmaster@1 85 # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
webmaster@1 86 #
webmaster@1 87 # To redirect all users to access the site WITHOUT the 'www.' prefix,
webmaster@1 88 # (http://www.example.com/... will be redirected to http://example.com/...)
webmaster@1 89 # uncomment and adapt the following:
webmaster@1 90 # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
webmaster@1 91 # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
webmaster@1 92
webmaster@1 93 # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
webmaster@1 94 # VirtualDocumentRoot and the rewrite rules are not working properly.
webmaster@1 95 # For example if your site is at http://example.com/drupal uncomment and
webmaster@1 96 # modify the following line:
webmaster@1 97 # RewriteBase /drupal
webmaster@1 98 #
webmaster@1 99 # If your site is running in a VirtualDocumentRoot at http://example.com/,
webmaster@1 100 # uncomment the following line:
webmaster@1 101 # RewriteBase /
webmaster@1 102
webmaster@7 103 # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
webmaster@1 104 RewriteCond %{REQUEST_FILENAME} !-f
webmaster@1 105 RewriteCond %{REQUEST_FILENAME} !-d
webmaster@7 106 RewriteCond %{REQUEST_URI} !=/favicon.ico
webmaster@1 107 RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
webmaster@1 108 </IfModule>
webmaster@1 109
webmaster@15 110 # $Id: .htaccess,v 1.90.2.3 2008/12/10 20:04:08 goba Exp $