forked from pimcore/pimcore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
61 lines (50 loc) · 2.45 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# mime types
AddType video/mp4 .mp4
AddType video/webm .webm
AddType image/jpeg .pjpeg
Options +FollowSymLinks
# rewrites
RewriteEngine On
RewriteBase /
<IfModule mod_status.c>
RewriteCond %{REQUEST_URI} ^/server-(info|status)
RewriteRule . - [last]
</IfModule>
<IfModule pagespeed_module>
# pimcore mod_pagespeed integration
# pimcore automatically disables mod_pagespeed in the following situations: debug-mode on, /admin, preview, editmode, ...
# if you want to disable pagespeed for specific actions in pimcore you can use $this->disableBrowserCache() in your action
RewriteCond %{REQUEST_URI} ^/(mod_)?pagespeed_(statistics|message|console|beacon)
RewriteRule . - [last]
#ModPagespeed On
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
ModPagespeedModifyCachingHeaders off
ModPagespeedRewriteLevel PassThrough
# low risk filters
ModPagespeedEnableFilters remove_comments,recompress_images
# low and moderate filters, recommended filters, but can cause problems
ModPagespeedEnableFilters lazyload_images,extend_cache_images,inline_preview_images,sprite_images
ModPagespeedEnableFilters combine_css,rewrite_css,move_css_to_head,flatten_css_imports,extend_cache_css,prioritize_critical_css
ModPagespeedEnableFilters extend_cache_scripts,combine_javascript,canonicalize_javascript_libraries,rewrite_javascript
# high risk
#ModPagespeedEnableFilters defer_javascript,local_storage_cache
</IfModule>
# ASSETS: check if request method is GET (because of WebDAV) and if the requested file (asset) exists on the filesystem, if both match, deliver the asset directly
RewriteCond %{REQUEST_METHOD} ^(GET|HEAD)
RewriteCond %{DOCUMENT_ROOT}/website/var/assets%{REQUEST_URI} -f
RewriteRule ^(.*)$ /website/var/assets%{REQUEST_URI} [PT,L]
# allow access to plugin-data and core assets
RewriteRule ^plugins/.*/static.* - [PT,L]
RewriteRule ^.*modules/.*/static.* - [PT,L]
RewriteRule ^pimcore/static.* - [PT,L]
# forbid the direct access to pimcore-internal data (eg. config-files, ...)
RewriteRule ^website/var/(?!tmp|assets|plugins|areas) / [F,L]
RewriteRule ^plugins/.*$ / [F,L]
RewriteRule ^pimcore/.*$ / [F,L]
# basic zend-framework setup see: http://framework.zend.com/manual/en/zend.controller.html
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]