You are here

default.txt in Boost 5

Same filename and directory in other branches
  1. 6 htaccess/default.txt
#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "(\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On
  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600
  # Do not cache dynamically generated pages.
  ExpiresByType text/html A1
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory and
  # the rewrite rules are not working properly.
  #RewriteBase /drupal

  # Rewrite old-style URLs of the form 'node.php?id=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  #RewriteRule node.php index.php?q=node/view/%1 [L]

  # Rewrite old-style URLs of the form 'module.php?mod=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  #RewriteRule module.php index.php?q=%1 [L]

  # Rewrite current-style URLs of the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

File

htaccess/default.txt
View source
  1. #
  2. # Apache/PHP/Drupal settings:
  3. #
  4. # Protect files and directories from prying eyes.
  5. Order allow,deny
  6. # Don't show directory listings for URLs which map to a directory.
  7. Options -Indexes
  8. # Follow symbolic links in this directory.
  9. Options +FollowSymLinks
  10. # Customized error messages.
  11. ErrorDocument 404 /index.php
  12. # Set the default handler.
  13. DirectoryIndex index.php
  14. # Override PHP settings. More in sites/default/settings.php
  15. # but the following cannot be changed at runtime.
  16. # PHP 4, Apache 1.
  17. php_value magic_quotes_gpc 0
  18. php_value register_globals 0
  19. php_value session.auto_start 0
  20. php_value mbstring.http_input pass
  21. php_value mbstring.http_output pass
  22. php_value mbstring.encoding_translation 0
  23. # PHP 4, Apache 2.
  24. php_value magic_quotes_gpc 0
  25. php_value register_globals 0
  26. php_value session.auto_start 0
  27. php_value mbstring.http_input pass
  28. php_value mbstring.http_output pass
  29. php_value mbstring.encoding_translation 0
  30. # PHP 5, Apache 1 and 2.
  31. php_value magic_quotes_gpc 0
  32. php_value register_globals 0
  33. php_value session.auto_start 0
  34. php_value mbstring.http_input pass
  35. php_value mbstring.http_output pass
  36. php_value mbstring.encoding_translation 0
  37. # Requires mod_expires to be enabled.
  38. # Enable expirations.
  39. ExpiresActive On
  40. # Cache all files for 2 weeks after access (A).
  41. ExpiresDefault A1209600
  42. # Do not cache dynamically generated pages.
  43. ExpiresByType text/html A1
  44. # Various rewrite rules.
  45. RewriteEngine on
  46. # If your site can be accessed both with and without the 'www.' prefix, you
  47. # can use one of the following settings to redirect users to your preferred
  48. # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  49. #
  50. # To redirect all users to access the site WITH the 'www.' prefix,
  51. # (http://example.com/... will be redirected to http://www.example.com/...)
  52. # adapt and uncomment the following:
  53. # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  54. # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  55. #
  56. # To redirect all users to access the site WITHOUT the 'www.' prefix,
  57. # (http://www.example.com/... will be redirected to http://example.com/...)
  58. # adapt and uncomment the following:
  59. # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  60. # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
  61. # Modify the RewriteBase if you are using Drupal in a subdirectory and
  62. # the rewrite rules are not working properly.
  63. #RewriteBase /drupal
  64. # Rewrite old-style URLs of the form 'node.php?id=x'.
  65. #RewriteCond %{REQUEST_FILENAME} !-f
  66. #RewriteCond %{REQUEST_FILENAME} !-d
  67. #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  68. #RewriteRule node.php index.php?q=node/view/%1 [L]
  69. # Rewrite old-style URLs of the form 'module.php?mod=x'.
  70. #RewriteCond %{REQUEST_FILENAME} !-f
  71. #RewriteCond %{REQUEST_FILENAME} !-d
  72. #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  73. #RewriteRule module.php index.php?q=%1 [L]
  74. # Rewrite current-style URLs of the form 'index.php?q=x'.
  75. RewriteCond %{REQUEST_FILENAME} !-f
  76. RewriteCond %{REQUEST_FILENAME} !-d
  77. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]