source: sandbox/2.4-expresso-api/.htaccess @ 5888

Revision 5888, 6.1 KB checked in by cristiano, 12 years ago (diff)

Ticket #2598 - implementação base REST + oauth

Line 
1#
2# Configuracoes principais
3#
4Options -ExecCGI -MultiViews -Indexes
5DirectoryIndex index.php index.html index.htm
6DefaultLanguage pt-BR
7AddDefaultCharset ISO-8859-1
8ServerSignature Off
9
10#
11# Configuracoes de "headers", cache e outras otimizacoes
12#
13# Disable caches and browsers from being able to validate files,
14# so they are forced to rely on your Cache-Control and Expires header.
15<ifModule mod_headers.c>
16        Header unset ETag
17</ifModule>
18FileETag None
19
20#-> http://www.htaccesselite.com/htaccess/cache-control-http-headers-vt65.html
21#      300   5 M
22#     2700  45 M
23#     3600   1 H
24#    54000  15 H
25#    86400   1 D
26#   518400   6 D
27#   604800   1 W
28#  1814400   3 W
29#  2419200   1 M
30# 26611200  11 M
31# 29030400   1 Y (never expire)
32
33## HEADER CACHING ##
34#-> http://www.htaccesselite.com/htaccess/caching-using-header-vt2.html
35#<FilesMatch "\.(flv|gif|jpg|jpeg|png|ico)$">
36#       Header set Cache-Control "max-age=2592000"
37#</FilesMatch>
38#<FilesMatch "\.(js|css|pdf|swf)$">
39#   Header set Cache-Control "max-age=604800"
40#</FilesMatch>
41#<FilesMatch "\.(html|htm|txt)$">
42#   Header set Cache-Control "max-age=600"
43#</FilesMatch>
44#<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
45#   Header unset Cache-Control
46#</FilesMatch>
47
48## ALTERNATE EXPIRES CACHING ##
49#-> htaccesselite.com/d/use-htaccess-to-speed-up-your-site-discussion-vt67.html
50#<ifModule mod_expires.c>
51#       ExpiresActive On
52#       ExpiresDefault "access plus 1 day"
53        # Permite que os arquivos sejam "cacheados" tanto para http quanto para https
54#       Header set Cache-Control "public"
55
56#       ExpiresByType text/html "access plus 1 hour"
57#       ExpiresByType text/plain "access plus 1 hour"
58#       ExpiresByType text/css "access plus 1 hour"
59#       ExpiresByType text/javascript "access plus 1 hour"
60#       ExpiresByType application/x-javascript "access plus 1 hour"
61
62#       ExpiresByType image/gif "access plus 1 week"
63#       ExpiresByType image/jpg "access plus 1 week"
64#       ExpiresByType image/png "access plus 1 week"
65
66        #<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
67                #ExpiresActive Off
68        #</FilesMatch>
69#</ifModule>
70
71#
72# Compactacao
73#
74<IfModule mod_deflate.c>
75        SetOutputFilter DEFLATE
76
77        AddOutputFilterByType DEFLATE application/x-httpd-php
78        AddOutputFilterByType DEFLATE application/x-javascript
79        AddOutputFilterByType DEFLATE application/x-httpd-fastphp
80        AddOutputFilterByType DEFLATE application/xhtml+xml
81        AddOutputFilterByType DEFLATE application/xml
82        AddOutputFilterByType DEFLATE application/rss+xml
83        AddOutputFilterByType DEFLATE application/atom_xml
84        AddOutputFilterByType DEFLATE text/html
85        AddOutputFilterByType DEFLATE text/plain
86        AddOutputFilterByType DEFLATE text/xml
87        AddOutputFilterByType DEFLATE text/css
88        AddOutputFilterByType DEFLATE image/svg+xml
89
90        # Use low settings for compression to make sure impact on server is low
91        #DeflateMemLevel 2
92        #Highest 9 - Lowest 1
93        #DeflateCompressionLevel 9
94
95        #Skip browsers with known problems
96        BrowserMatch ^Mozilla/4 gzip-only-text/html
97        BrowserMatch ^Mozilla/4\.0[678] no-gzip
98        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
99
100        # properly handle requests coming from behind proxies
101        <IfModule mod_headers.c>
102                # Make sure proxies don't deliver the wrong content
103                Header append Vary User-Agent env=!dont-vary
104        </IfModule>
105
106        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
107        SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
108        SetEnvIfNoCase Request_URI \.(?:avi|mov|mp3|ogg|wmv|wma)$ no-gzip dont-vary
109        SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
110
111        # Log file compression
112#       DeflateFilterNote Input instream
113#       DeflateFilterNote Output outstream
114#       DeflateFilterNote Ratio ratio
115#       LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
116#       CustomLog /var/log/apache2/deflate.log deflate
117
118</ifModule>
119
120
121#
122# Reescritas e redirecionamentos
123#
124RewriteEngine On
125## DENY REQUEST BASED ON REQUEST METHOD ##
126RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)$ [NC]
127RewriteRule ^.*$ - [F]
128RewriteRule ^rest(.*)$ prototype/rest/$1 [QSA,L]
129
130#
131# Seguranca e restricoes de acesso
132#
133# Ao próprio htaccess e outros arquivos sensiveis (como senhas)
134<Files ~ "\.(htaccess|htpasswd|ini|srv|log|sh|svn)$">
135        Order Allow,Deny
136        Deny from all
137        Satisfy any
138</Files>
139
140#<Location /setup>
141#       Options None
142#        Order deny,allow
143#       # Sua rede local
144#        allow from 192.168.0.0/24
145#</Location>
146
147#
148# Configuracoes do PHP para o Expresso
149#
150php_value expose_php Off
151php_value short_open_tag On
152php_value zlib.output_compression Off
153php_value magic_quotes_gpc Off
154php_value magic_quotes_runtime Off
155php_value register_globals Off
156php_value register_long_arrays Off
157php_value output_buffering Off
158php_value allow_call_time_pass_reference On
159php_value variables_order "EGPCS"
160php_value register_argc_argv On
161php_value default_charset "iso-8859-1"
162php_value default_mimetype "text/html"
163php_value date.timezone "America/Sao_Paulo"
164php_value allow_url_include Off
165php_value url_rewriter.tags "a=href,area=href,frame=src,input=src,form=,fieldset="
166
167php_value session.auto_start 0
168php_value session.use_cookies 0
169# Uses dir as a session handler
170php_value session.save_handler "files"
171php_value session.save_path "/var/lib/php/session"
172#php_value session.save_path "/dev/shm"
173# Use memcache as a session handler
174#php_value session.save_handler "memcache"
175#php_value session.save_path "tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
176php_value session.serialize_handler php
177php_value session.gc_probability 1
178php_value session.gc_divisor 100
179php_value session.gc_maxlifetime 1440
180php_value session.bug_compat_42 0
181php_value session.bug_compat_warn 1
182php_value session.cache_limiter nocache
183php_value session.cache_expire 180
184php_value session.use_trans_sid 0
185
186php_value mbstring.func_overload 0
187#php_value mbstring.func_overload 7
188
189php_value max_execution_time 90
190php_value max_input_time 120
191php_value memory_limit 196M
192php_value post_max_size 50M
193php_value upload_max_filesize 40M
194
195#php_value error_reporting "E_ALL"
196#php_value error_reporting "E_ALL & ~E_NOTICE"
197#php_value display_errors Off
198#php_value display_startup_errors On
199#php_value log_errors On
200#php_value ignore_repeated_errors On
201#php_value report_memleaks On
202#php_value html_errors On
203#php_value error_log /dev/shm/php.log
Note: See TracBrowser for help on using the repository browser.