Guest User

Untitled

a guest
Apr 15th, 2018
668
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ##
  2. # Contao Open Source CMS
  3. #
  4. # Copyright (C) 2005-2013 Leo Feyer
  5. #
  6. # @package Core
  7. # @link https://contao.org
  8. # @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
  9. ##
  10.  
  11. ##
  12. # Prevent access to the Contao template files
  13. ##
  14. <FilesMatch "\.(tpl|html5|xhtml)$">
  15. Order allow,deny
  16. Deny from all
  17. </FilesMatch>
  18.  
  19. ##
  20. # Allow access from all domains for webfonts
  21. # @see https://github.com/h5bp/html5-boilerplate
  22. ##
  23. <IfModule mod_headers.c>
  24. <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
  25. Header set Access-Control-Allow-Origin "*"
  26. </FilesMatch>
  27. </IfModule>
  28.  
  29. ##
  30. # Disable ETags
  31. # @see http://developer.yahoo.com/performance/rules.html#etags
  32. ##
  33. FileETag None
  34. <IfModule mod_headers.c>
  35. Header unset ETag
  36. </IfModule>
  37.  
  38. ##
  39. # Set the proper MIME types
  40. # @see https://github.com/h5bp/html5-boilerplate
  41. ##
  42. <IfModule mod_mime.c>
  43. AddType application/javascript js jsonp
  44. AddType application/json json
  45. AddType audio/ogg oga ogg
  46. AddType audio/mp4 m4a f4a f4b
  47. AddType video/ogg ogv
  48. AddType video/mp4 mp4 m4v f4v f4p
  49. AddType video/webm webm
  50. AddType video/x-flv flv
  51. AddType image/svg+xml svg svgz
  52. AddEncoding gzip svgz
  53. AddType application/vnd.ms-fontobject eot
  54. AddType application/x-font-ttf ttf ttc
  55. AddType font/opentype otf
  56. AddType application/x-font-woff woff
  57. AddType image/x-icon ico
  58. AddType image/webp webp
  59. AddType text/cache-manifest appcache manifest
  60. AddType text/x-component htc
  61. AddType application/xml rss atom xml rdf
  62. AddType application/x-web-app-manifest+json webapp
  63. AddType text/x-vcard vcf
  64. AddType application/x-shockwave-flash swf
  65. </IfModule>
  66.  
  67. ##
  68. # Gzip compression
  69. # @see https://github.com/h5bp/html5-boilerplate
  70. ##
  71. <IfModule mod_deflate.c>
  72. <IfModule mod_filter.c>
  73. AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
  74. AddOutputFilterByType DEFLATE application/javascript
  75. AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
  76. AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
  77. AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
  78. </IfModule>
  79. </IfModule>
  80.  
  81. ##
  82. # Expires headers (for better cache control)
  83. # @see https://github.com/h5bp/html5-boilerplate
  84. ##
  85. <IfModule mod_expires.c>
  86. ExpiresActive on
  87.  
  88. ##
  89. # Productional website
  90. ##
  91. ExpiresByType text/cache-manifest "access plus 0 seconds"
  92. ExpiresByType text/html "access plus 0 seconds"
  93. ExpiresByType text/xml "access plus 0 seconds"
  94. ExpiresByType application/xml "access plus 0 seconds"
  95. ExpiresByType application/json "access plus 0 seconds"
  96. ExpiresByType application/rss+xml "access plus 1 hour"
  97. ExpiresByType application/atom+xml "access plus 1 hour"
  98. ExpiresByType image/gif "access plus 1 month"
  99. ExpiresByType image/png "access plus 1 month"
  100. ExpiresByType image/jpeg "access plus 1 month"
  101. ExpiresByType image/x-icon "access plus 1 month"
  102. ExpiresByType video/ogg "access plus 1 month"
  103. ExpiresByType audio/ogg "access plus 1 month"
  104. ExpiresByType video/mp4 "access plus 1 month"
  105. ExpiresByType video/webm "access plus 1 month"
  106. ExpiresByType text/x-component "access plus 1 month"
  107. ExpiresByType application/x-font-ttf "access plus 1 month"
  108. ExpiresByType font/opentype "access plus 1 month"
  109. ExpiresByType application/x-font-woff "access plus 1 month"
  110. ExpiresByType image/svg+xml "access plus 1 month"
  111. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  112. ExpiresByType text/css "access plus 1 year"
  113. ExpiresByType application/javascript "access plus 1 year"
  114.  
  115. ##
  116. # Disable caching during development
  117. # @see https://github.com/contao/core/issues/4364
  118. ##
  119. #ExpiresByType text/cache-manifest "access"
  120. #ExpiresByType text/html "access"
  121. #ExpiresByType text/xml "access"
  122. #ExpiresByType application/xml "access"
  123. #ExpiresByType application/json "access"
  124. #ExpiresByType application/rss+xml "access"
  125. #ExpiresByType application/atom+xml "access"
  126. #ExpiresByType image/gif "access"
  127. #ExpiresByType image/png "access"
  128. #ExpiresByType image/jpeg "access"
  129. #ExpiresByType image/x-icon "access"
  130. #ExpiresByType video/ogg "access"
  131. #ExpiresByType audio/ogg "access"
  132. #ExpiresByType video/mp4 "access"
  133. #ExpiresByType video/webm "access"
  134. #ExpiresByType text/x-component "access"
  135. #ExpiresByType application/x-font-ttf "access"
  136. #ExpiresByType font/opentype "access"
  137. #ExpiresByType application/x-font-woff "access"
  138. #ExpiresByType image/svg+xml "access"
  139. #ExpiresByType application/vnd.ms-fontobject "access"
  140. #ExpiresByType text/css "access"
  141. #ExpiresByType application/javascript "access"
  142.  
  143. </IfModule>
  144.  
  145. ##
  146. # Header adjustments
  147. ##
  148. <IfModule mod_headers.c>
  149.  
  150. ##
  151. # Disable caching during development
  152. # @see https://github.com/contao/core/issues/4364
  153. ##
  154. #Header unset Cache-Control
  155. #Header append Cache-Control must-revalidate
  156.  
  157. ##
  158. # Do not cache the cron.txt file
  159. # @see https://github.com/contao/core/issues/5105
  160. ##
  161. <FilesMatch "cron\.txt$">
  162. Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform"
  163. </FilesMatch>
  164.  
  165. ##
  166. # Add a Vary Accept-Encoding header for the compressed resources. If you
  167. # modify the file types above, make sure to change them here accordingly.
  168. # @see http://developer.yahoo.com/performance/rules.html#gzip
  169. #
  170. # Note: If you are using a case-sensitive file system like HFS+ or ext4, you
  171. # have to change the <FilesMatch> directive as follows:
  172. #
  173. # <FilesMatch "\.(?i:js|css|xml|gz)$">
  174. #
  175. # For more information see: https://github.com/contao/core/issues/4364
  176. ##
  177. <FilesMatch "\.(js|css|xml|gz)$">
  178. Header append Vary Accept-Encoding
  179. </FilesMatch>
  180.  
  181. </IfModule>
  182.  
  183. ##
  184. # Disable MultiViews if you are having issues with requests returning the wrong
  185. # page. Requires AllowOverride Options=All,MultiViews to be set here.
  186. # @see https://github.com/contao/core/issues/3521
  187. ##
  188. #Options -MultiViews
  189.  
  190. ##
  191. # URL rewriting
  192. ##
  193. <IfModule mod_rewrite.c>
  194. RewriteEngine On
  195.  
  196. ##
  197. # Change the RewriteBase if your Contao installation is in a subdirectoy and
  198. # the rewrite rules are not working properly. Usage examples:
  199. #
  200. # RewriteBase /contao-3.0.0
  201. # RewriteBase /path/to/contao
  202. #
  203. # Depending on your server, you might have to remove the line entirely.
  204. ##
  205. RewriteBase /
  206.  
  207. ##
  208. # Uncomment to redirect domains without "www" to the "www" subdomain.
  209. ##
  210. #RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
  211. #RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  212.  
  213. ##
  214. # Uncomment to redirect domains with "www" to the empty domain.
  215. ##
  216. RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  217. RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
  218.  
  219. ##
  220. # If you cannot use mod_deflate, uncomment the following lines to load a
  221. # compressed .gz version of the aggregated Contao JavaScript and CSS files.
  222. ##
  223. #AddEncoding gzip .gz
  224. #<FilesMatch "\.js\.gz$">
  225. # AddType "text/javascript" .gz
  226. #</FilesMatch>
  227. #<FilesMatch "\.css\.gz$">
  228. # AddType "text/css" .gz
  229. #</FilesMatch>
  230. #RewriteCond %{HTTP:Accept-encoding} gzip
  231. #RewriteCond %{REQUEST_FILENAME} \.(js|css)$
  232. #RewriteCond %{REQUEST_FILENAME}.gz -f
  233. #RewriteRule ^(.*)$ $1.gz [QSA,L]
  234.  
  235. ##
  236. # Do not rewrite requests for static files or folders such as style sheets,
  237. # images, movies or text documents. Do not add the URL suffix here!
  238. #
  239. # Note: If you are using a case-sensitive file system like HFS+ or ext4, you
  240. # have to change the <FilesMatch> directive as follows:
  241. #
  242. # <FilesMatch "\.(?i:htm|php|js|css| . |gz)$">
  243. #
  244. # For more information see: https://github.com/contao/core/issues/4364
  245. ##
  246. <FilesMatch "\.(htm|php|js|css|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|mp3|mp4|webm|ogv|eot|woff|svg|ttf|pdf|gz)$">
  247. RewriteEngine Off
  248. </FilesMatch>
  249.  
  250. ##
  251. # By default, Contao adds ".html" to the generated URLs to simulate static
  252. # HTML documents. If you change the URL suffix in the back end settings, make
  253. # sure to change it here accordingly!
  254. #
  255. # RewriteRule .*\.html$ index.php [L] # URL suffix .html
  256. # RewriteRule .*\.txt$ index.php [L] # URL suffix .txt
  257. # RewriteRule .*\.json$ index.php [L] # URL suffix .json
  258. #
  259. # If you do not want to use an URL suffix at all, you have to add a second
  260. # line to prevent URLs that point to folders from being rewritten (see #4031).
  261. #
  262. # RewriteCond %{REQUEST_FILENAME} !-d
  263. # RewriteRule .* index.php [L]
  264. #
  265. # If you are using mod_cache, it is recommended to use the RewriteRule below,
  266. # which adds the query string to the internal URL:
  267. #
  268. # RewriteRule (.*\.html)$ index.php/$1 [L]
  269. #
  270. # Note that not all environments support mod_rewrite and mod_cache.
  271. ##
  272. ## RewriteCond %{REQUEST_FILENAME} !-f
  273. ## RewriteRule .*\.html$ index.php [L]
  274.  
  275.  
  276.  
  277. RewriteCond %{REQUEST_FILENAME} !-d
  278. RewriteRule .* index.php [L]
  279.  
  280. RewriteCond %{REQUEST_FILENAME} !-f
  281. RewriteRule .*\.html$ index.php [L]
  282.  
  283. ##
  284. # The following rules are required if you want to pass the language as first
  285. # URL parameter (added in Contao 2.11). The first rule rewrites an empty URL
  286. # to the front end controller, the second one adds a missing trailing slash.
  287. ##
  288. RewriteRule ^[a-z]{2}/$ index.php [L]
  289. RewriteRule ^([a-z]{2})$ $1/ [R=301,L]
  290.  
  291.  
  292. </IfModule>
RAW Paste Data