annotate .htaccess @ 7:fff6d4c8c043 6.3

Drupal 6.3
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:30:28 +0100
parents c1f4ac30525a
children 4347c45bb494
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@1 6 <FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
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@7 21 ErrorDocument 404 "The requested file favicon.ico was not found.
webmaster@7 22 </Files>
webmaster@7 23
webmaster@1 24 # Set the default handler.
webmaster@1 25 DirectoryIndex index.php
webmaster@1 26
webmaster@1 27 # Override PHP settings. More in sites/default/settings.php
webmaster@1 28 # but the following cannot be changed at runtime.
webmaster@1 29
webmaster@1 30 # PHP 4, Apache 1.
webmaster@1 31 <IfModule mod_php4.c>
webmaster@1 32 php_value magic_quotes_gpc 0
webmaster@1 33 php_value register_globals 0
webmaster@1 34 php_value session.auto_start 0
webmaster@1 35 php_value mbstring.http_input pass
webmaster@1 36 php_value mbstring.http_output pass
webmaster@1 37 php_value mbstring.encoding_translation 0
webmaster@1 38 </IfModule>
webmaster@1 39
webmaster@1 40 # PHP 4, Apache 2.
webmaster@1 41 <IfModule sapi_apache2.c>
webmaster@1 42 php_value magic_quotes_gpc 0
webmaster@1 43 php_value register_globals 0
webmaster@1 44 php_value session.auto_start 0
webmaster@1 45 php_value mbstring.http_input pass
webmaster@1 46 php_value mbstring.http_output pass
webmaster@1 47 php_value mbstring.encoding_translation 0
webmaster@1 48 </IfModule>
webmaster@1 49
webmaster@1 50 # PHP 5, Apache 1 and 2.
webmaster@1 51 <IfModule mod_php5.c>
webmaster@1 52 php_value magic_quotes_gpc 0
webmaster@1 53 php_value register_globals 0
webmaster@1 54 php_value session.auto_start 0
webmaster@1 55 php_value mbstring.http_input pass
webmaster@1 56 php_value mbstring.http_output pass
webmaster@1 57 php_value mbstring.encoding_translation 0
webmaster@1 58 </IfModule>
webmaster@1 59
webmaster@1 60 # Requires mod_expires to be enabled.
webmaster@1 61 <IfModule mod_expires.c>
webmaster@1 62 # Enable expirations.
webmaster@1 63 ExpiresActive On
webmaster@1 64
webmaster@1 65 # Cache all files for 2 weeks after access (A).
webmaster@1 66 ExpiresDefault A1209600
webmaster@1 67
webmaster@1 68 # Do not cache dynamically generated pages.
webmaster@1 69 ExpiresByType text/html A1
webmaster@1 70 </IfModule>
webmaster@1 71
webmaster@1 72 # Various rewrite rules.
webmaster@1 73 <IfModule mod_rewrite.c>
webmaster@1 74 RewriteEngine on
webmaster@1 75
webmaster@1 76 # If your site can be accessed both with and without the 'www.' prefix, you
webmaster@1 77 # can use one of the following settings to redirect users to your preferred
webmaster@1 78 # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
webmaster@1 79 #
webmaster@1 80 # To redirect all users to access the site WITH the 'www.' prefix,
webmaster@1 81 # (http://example.com/... will be redirected to http://www.example.com/...)
webmaster@1 82 # adapt and uncomment the following:
webmaster@1 83 # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
webmaster@1 84 # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
webmaster@1 85 #
webmaster@1 86 # To redirect all users to access the site WITHOUT the 'www.' prefix,
webmaster@1 87 # (http://www.example.com/... will be redirected to http://example.com/...)
webmaster@1 88 # uncomment and adapt the following:
webmaster@1 89 # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
webmaster@1 90 # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
webmaster@1 91
webmaster@1 92 # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
webmaster@1 93 # VirtualDocumentRoot and the rewrite rules are not working properly.
webmaster@1 94 # For example if your site is at http://example.com/drupal uncomment and
webmaster@1 95 # modify the following line:
webmaster@1 96 # RewriteBase /drupal
webmaster@1 97 #
webmaster@1 98 # If your site is running in a VirtualDocumentRoot at http://example.com/,
webmaster@1 99 # uncomment the following line:
webmaster@1 100 # RewriteBase /
webmaster@1 101
webmaster@7 102 # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
webmaster@1 103 RewriteCond %{REQUEST_FILENAME} !-f
webmaster@1 104 RewriteCond %{REQUEST_FILENAME} !-d
webmaster@7 105 RewriteCond %{REQUEST_URI} !=/favicon.ico
webmaster@1 106 RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
webmaster@1 107 </IfModule>
webmaster@1 108
webmaster@7 109 # $Id: .htaccess,v 1.90.2.1 2008/07/08 09:33:14 goba Exp $