.htaccess 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #
  2. # Apache/PHP/Drupal settings:
  3. #
  4. ### Enable rewrite-engine and define global redirections ###
  5. RewriteEngine on
  6. ### !end of global redirections ###
  7. ### www and non-www URL rewritting ###
  8. RewriteCond %{HTTP_HOST} ^www.gip-epau.archi.fr$ [OR]
  9. RewriteCond %{HTTP_HOST} ^gip-epau.archi.fr$ [OR]
  10. RewriteCond %{HTTP_HOST} ^popsu.archi.fr$
  11. RewriteRule ^(.*) http://www.popsu.archi.fr/$1 [QSA,L,R=301]
  12. ### !end of rewrite rules ###
  13. ### URL rewritting ###
  14. RewriteRule ^public/$ http://www.popsu.archi.fr/ [QSA,L,R=301]
  15. RewriteRule ^POPSU$ http://www.popsu.archi.fr/ [QSA,L,R=301]
  16. RewriteRule ^POPSU2/$ http://www.popsu.archi.fr/ [QSA,L,R=301]
  17. RewriteRule ^Europe/$ http://www.popsu.archi.fr/ [QSA,L,R=301]
  18. RewriteRule ^POPSU2/intranet/$ http://www.popsu.archi.fr/ [QSA,L,R=301]
  19. RewriteRule ^POPSU/valorisation/spip.php$ http://www.popsu.archi.fr/ [QSA,L,R=301]
  20. ### !end of rewrite rules ###
  21. # Protect files and directories from prying eyes.
  22. <FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
  23. Order allow,deny
  24. </FilesMatch>
  25. # Don't show directory listings for URLs which map to a directory.
  26. Options -Indexes
  27. # Follow symbolic links in this directory.
  28. Options +FollowSymLinks
  29. # Make Drupal handle any 404 errors.
  30. ErrorDocument 404 /index.php
  31. # # Cette règle pose problème sur le serveur ARCHI.fr --- !!!!!!!
  32. # # Set the default handler.
  33. # DirectoryIndex index.php index.html index.htm
  34. # # ----- !!!!!!
  35. # Override PHP settings that cannot be changed at runtime. See
  36. # sites/default/default.settings.php and drupal_environment_initialize() in
  37. # includes/bootstrap.inc for settings that can be changed at runtime.
  38. # PHP 5, Apache 1 and 2.
  39. <IfModule mod_php5.c>
  40. php_flag magic_quotes_gpc off
  41. php_flag magic_quotes_sybase off
  42. php_flag register_globals off
  43. php_flag session.auto_start off
  44. php_value mbstring.http_input pass
  45. php_value mbstring.http_output pass
  46. php_flag mbstring.encoding_translation off
  47. </IfModule>
  48. # Requires mod_expires to be enabled.
  49. <IfModule mod_expires.c>
  50. # Enable expirations.
  51. ExpiresActive On
  52. # Cache all files for 2 weeks after access (A).
  53. ExpiresDefault A1209600
  54. <FilesMatch \.php$>
  55. # Do not allow PHP scripts to be cached unless they explicitly send cache
  56. # headers themselves. Otherwise all scripts would have to overwrite the
  57. # headers set by mod_expires if they want another caching behavior. This may
  58. # fail if an error occurs early in the bootstrap process, and it may cause
  59. # problems if a non-Drupal PHP file is installed in a subdirectory.
  60. ExpiresActive Off
  61. </FilesMatch>
  62. </IfModule>
  63. # Various rewrite rules.
  64. <IfModule mod_rewrite.c>
  65. RewriteEngine on
  66. # Block access to "hidden" directories whose names begin with a period. This
  67. # includes directories used by version control systems such as Subversion or
  68. # Git to store control files. Files whose names begin with a period, as well
  69. # as the control files used by CVS, are protected by the FilesMatch directive
  70. # above.
  71. #
  72. # NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
  73. # not possible to block access to entire directories from .htaccess, because
  74. # <DirectoryMatch> is not allowed here.
  75. #
  76. # If you do not have mod_rewrite installed, you should remove these
  77. # directories from your webroot or otherwise protect them from being
  78. # downloaded.
  79. RewriteRule "(^|/)\." - [F]
  80. # If your site can be accessed both with and without the 'www.' prefix, you
  81. # can use one of the following settings to redirect users to your preferred
  82. # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  83. #
  84. # To redirect all users to access the site WITH the 'www.' prefix,
  85. # (http://example.com/... will be redirected to http://www.example.com/...)
  86. # uncomment the following:
  87. # RewriteCond %{HTTP_HOST} !^www\. [NC]
  88. # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  89. #
  90. # To redirect all users to access the site WITHOUT the 'www.' prefix,
  91. # (http://www.example.com/... will be redirected to http://example.com/...)
  92. # uncomment the following:
  93. # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  94. # RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]
  95. # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  96. # VirtualDocumentRoot and the rewrite rules are not working properly.
  97. # For example if your site is at http://example.com/drupal uncomment and
  98. # modify the following line:
  99. # RewriteBase /drupal
  100. #
  101. # If your site is running in a VirtualDocumentRoot at http://example.com/,
  102. # uncomment the following line:
  103. # RewriteBase /
  104. # Pass all requests not referring directly to files in the filesystem to
  105. # index.php. Clean URLs are handled in drupal_environment_initialize().
  106. RewriteCond %{REQUEST_FILENAME} !-f
  107. RewriteCond %{REQUEST_FILENAME} !-d
  108. RewriteCond %{REQUEST_URI} !=/favicon.ico
  109. RewriteRule ^ index.php [L]
  110. # Rules to correctly serve gzip compressed CSS and JS files.
  111. # Requires both mod_rewrite and mod_headers to be enabled.
  112. <IfModule mod_headers.c>
  113. # Serve gzip compressed CSS files if they exist and the client accepts gzip.
  114. RewriteCond %{HTTP:Accept-encoding} gzip
  115. RewriteCond %{REQUEST_FILENAME}\.gz -s
  116. RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
  117. # Serve gzip compressed JS files if they exist and the client accepts gzip.
  118. RewriteCond %{HTTP:Accept-encoding} gzip
  119. RewriteCond %{REQUEST_FILENAME}\.gz -s
  120. RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
  121. # Serve correct content types, and prevent mod_deflate double gzip.
  122. RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
  123. RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
  124. <FilesMatch "(\.js\.gz|\.css\.gz)$">
  125. # Serve correct encoding type.
  126. Header set Content-Encoding gzip
  127. # Force proxies to cache gzipped & non-gzipped css/js files separately.
  128. Header append Vary Accept-Encoding
  129. </FilesMatch>
  130. </IfModule>
  131. </IfModule>