Advertisement
divinosilva

Untitled

Dec 19th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 11.95 KB | None | 0 0
  1. # Definir manutenção do site!
  2. #<ifModule mod_rewrite.c>
  3.   #RewriteEngine on
  4.   #RewriteCond %{REMOTE_ADDR} !^xxx.xx.xx.xxx
  5.   #RewriteCond %{REQUEST_URI} !/sites.php$ [NC]
  6.   #RewriteCond %{REQUEST_URI} !.(jpe?g?|png|gif|js|css|jpg|ico) [NC]
  7.   #RewriteRule .* /sites.php [R=302,L]
  8. #</ifModule>
  9.  
  10. # BEGIN W3TC Browser Cache
  11. <IfModule mod_mime.c>
  12.     AddType text/css .css
  13.     AddType text/x-component .htc
  14.     AddType application/x-javascript .js
  15.     AddType application/javascript .js2
  16.     AddType text/javascript .js3
  17.     AddType text/x-js .js4
  18.     AddType video/asf .asf .asx .wax .wmv .wmx
  19.     AddType video/avi .avi
  20.     AddType image/bmp .bmp
  21.     AddType application/java .class
  22.     AddType video/divx .divx
  23.     AddType application/msword .doc .docx
  24.     AddType application/vnd.ms-fontobject .eot
  25.     AddType application/x-msdownload .exe
  26.     AddType image/gif .gif
  27.     AddType application/x-gzip .gz .gzip
  28.     AddType image/x-icon .ico
  29.     AddType image/jpeg .jpg .jpeg .jpe
  30.     AddType image/webp .webp
  31.     AddType application/json .json
  32.     AddType application/vnd.ms-access .mdb
  33.     AddType audio/midi .mid .midi
  34.     AddType video/quicktime .mov .qt
  35.     AddType audio/mpeg .mp3 .m4a
  36.     AddType video/mp4 .mp4 .m4v
  37.     AddType video/mpeg .mpeg .mpg .mpe
  38.     AddType application/vnd.ms-project .mpp
  39.     AddType application/x-font-otf .otf
  40.     AddType application/vnd.ms-opentype ._otf
  41.     AddType application/vnd.oasis.opendocument.database .odb
  42.     AddType application/vnd.oasis.opendocument.chart .odc
  43.     AddType application/vnd.oasis.opendocument.formula .odf
  44.     AddType application/vnd.oasis.opendocument.graphics .odg
  45.     AddType application/vnd.oasis.opendocument.presentation .odp
  46.     AddType application/vnd.oasis.opendocument.spreadsheet .ods
  47.     AddType application/vnd.oasis.opendocument.text .odt
  48.     AddType audio/ogg .ogg
  49.     AddType application/pdf .pdf
  50.     AddType image/png .png
  51.     AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
  52.     AddType audio/x-realaudio .ra .ram
  53.     AddType image/svg+xml .svg .svgz
  54.     AddType application/x-shockwave-flash .swf
  55.     AddType application/x-tar .tar
  56.     AddType image/tiff .tif .tiff
  57.     AddType application/x-font-ttf .ttf .ttc
  58.     AddType application/vnd.ms-opentype ._ttf
  59.     AddType audio/wav .wav
  60.     AddType audio/wma .wma
  61.     AddType application/vnd.ms-write .wri
  62.     AddType application/font-woff .woff
  63.     AddType application/font-woff2 .woff2
  64.     AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
  65.     AddType application/zip .zip
  66. </IfModule>
  67. <IfModule mod_expires.c>
  68.     ExpiresActive On
  69.     ExpiresByType text/css A31536000
  70.     ExpiresByType text/x-component A31536000
  71.     ExpiresByType application/x-javascript A31536000
  72.     ExpiresByType application/javascript A31536000
  73.     ExpiresByType text/javascript A31536000
  74.     ExpiresByType text/x-js A31536000
  75.     ExpiresByType video/asf A31536000
  76.     ExpiresByType video/avi A31536000
  77.     ExpiresByType image/bmp A31536000
  78.     ExpiresByType application/java A31536000
  79.     ExpiresByType video/divx A31536000
  80.     ExpiresByType application/msword A31536000
  81.     ExpiresByType application/vnd.ms-fontobject A31536000
  82.     ExpiresByType application/x-msdownload A31536000
  83.     ExpiresByType image/gif A31536000
  84.     ExpiresByType application/x-gzip A31536000
  85.     ExpiresByType image/x-icon A31536000
  86.     ExpiresByType image/jpeg A31536000
  87.     ExpiresByType image/webp A31536000
  88.     ExpiresByType application/json A31536000
  89.     ExpiresByType application/vnd.ms-access A31536000
  90.     ExpiresByType audio/midi A31536000
  91.     ExpiresByType video/quicktime A31536000
  92.     ExpiresByType audio/mpeg A31536000
  93.     ExpiresByType video/mp4 A31536000
  94.     ExpiresByType video/mpeg A31536000
  95.     ExpiresByType application/vnd.ms-project A31536000
  96.     ExpiresByType application/x-font-otf A31536000
  97.     ExpiresByType application/vnd.ms-opentype A31536000
  98.     ExpiresByType application/vnd.oasis.opendocument.database A31536000
  99.     ExpiresByType application/vnd.oasis.opendocument.chart A31536000
  100.     ExpiresByType application/vnd.oasis.opendocument.formula A31536000
  101.     ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
  102.     ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
  103.     ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
  104.     ExpiresByType application/vnd.oasis.opendocument.text A31536000
  105.     ExpiresByType audio/ogg A31536000
  106.     ExpiresByType application/pdf A31536000
  107.     ExpiresByType image/png A31536000
  108.     ExpiresByType application/vnd.ms-powerpoint A31536000
  109.     ExpiresByType audio/x-realaudio A31536000
  110.     ExpiresByType image/svg+xml A31536000
  111.     ExpiresByType application/x-shockwave-flash A31536000
  112.     ExpiresByType application/x-tar A31536000
  113.     ExpiresByType image/tiff A31536000
  114.     ExpiresByType application/x-font-ttf A31536000
  115.     ExpiresByType application/vnd.ms-opentype A31536000
  116.     ExpiresByType audio/wav A31536000
  117.     ExpiresByType audio/wma A31536000
  118.     ExpiresByType application/vnd.ms-write A31536000
  119.     ExpiresByType application/font-woff A31536000
  120.     ExpiresByType application/font-woff2 A31536000
  121.     ExpiresByType application/vnd.ms-excel A31536000
  122.     ExpiresByType application/zip A31536000
  123. </IfModule>
  124. <IfModule mod_deflate.c>
  125.         AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon image/webp application/json application/vnd.ms-access application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.presentation application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint image/svg+xml application/x-shockwave-flash image/tiff application/x-font-ttf application/vnd.ms-opentype audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel
  126.     <IfModule mod_mime.c>
  127.         # DEFLATE by extension
  128.         AddOutputFilter DEFLATE js css htm html xml
  129.     </IfModule>
  130. </IfModule>
  131. <FilesMatch "\.(css|htc|less|js|js2|js3|js4|CSS|HTC|LESS|JS|JS2|JS3|JS4)$">
  132.     FileETag MTime Size
  133.     <IfModule mod_headers.c>
  134.          Header unset Set-Cookie
  135.     </IfModule>
  136. </FilesMatch>
  137. <FilesMatch "\.(html|htm|rtf|rtx|svg|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|TXT|XSD|XSL|XML)$">
  138.     FileETag MTime Size
  139.     <IfModule mod_headers.c>
  140.         Header append Vary User-Agent env=!dont-vary
  141.     </IfModule>
  142. </FilesMatch>
  143. <FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|webp|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|_ttf|wav|wma|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|WEBP|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|_TTF|WAV|WMA|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
  144.     FileETag MTime Size
  145.     <IfModule mod_headers.c>
  146.          Header unset Set-Cookie
  147.     </IfModule>
  148. </FilesMatch>
  149. <FilesMatch "\.(bmp|class|doc|docx|eot|exe|ico|webp|json|mdb|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|pot|pps|ppt|pptx|svg|svgz|swf|tif|tiff|ttf|ttc|_ttf|wav|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|BMP|CLASS|DOC|DOCX|EOT|EXE|ICO|WEBP|JSON|MDB|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|POT|PPS|PPT|PPTX|SVG|SVGZ|SWF|TIF|TIFF|TTF|TTC|_TTF|WAV|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW)$">
  150.     <IfModule mod_headers.c>
  151.          Header unset Last-Modified
  152.     </IfModule>
  153. </FilesMatch>
  154. <IfModule mod_headers.c>
  155.     Header set Referrer-Policy ""
  156. </IfModule>
  157. # END W3TC Browser Cache
  158. # BEGIN W3TC Page Cache core
  159. <IfModule mod_rewrite.c>
  160.     RewriteEngine On
  161.     RewriteBase /
  162.     RewriteCond %{HTTPS} =on
  163.     RewriteRule .* - [E=W3TC_SSL:_ssl]
  164.     RewriteCond %{SERVER_PORT} =443
  165.     RewriteRule .* - [E=W3TC_SSL:_ssl]
  166.     RewriteCond %{HTTP:X-Forwarded-Proto} =https [NC]
  167.     RewriteRule .* - [E=W3TC_SSL:_ssl]
  168.     RewriteCond %{HTTP:Accept-Encoding} gzip
  169.     RewriteRule .* - [E=W3TC_ENC:_gzip]
  170.     RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
  171.     RewriteRule .* - [E=W3TC_PREVIEW:_preview]
  172.     RewriteCond %{REQUEST_METHOD} !=POST
  173.     RewriteCond %{QUERY_STRING} =""
  174.     RewriteCond %{REQUEST_URI} \/$
  175.     RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
  176.     RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
  177.     RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
  178. </IfModule>
  179. # END W3TC Page Cache core
  180.  
  181.  
  182. # BEGIN WordPress
  183. <IfModule mod_rewrite.c>
  184. RewriteEngine On
  185. RewriteBase /
  186. RewriteRule ^index\.php$ - [L]
  187. RewriteCond %{REQUEST_FILENAME} !-f
  188. RewriteCond %{REQUEST_FILENAME} !-d
  189. RewriteRule . /index.php [L]
  190. </IfModule>
  191. # END WordPress
  192.  
  193. # tamanho máximo de upload
  194. php_value upload_max_filesize 128M
  195. php_value post_max_size 128M
  196. php_value max_execution_time 300
  197. php_value max_input_time 300
  198.  
  199. #  Protegendo seu arquivo .htaccess!
  200. <files ~ "^.*\.([Hh][Tt][Aa])">
  201. order allow,deny
  202. deny from all
  203. satisfy all
  204. </files>
  205.  
  206. # Forçando UTF­8!
  207. <FilesMatch ".(php|htm|html|css|js)$">
  208. AddDefaultCharset UTF‐8
  209. </FilesMatch>
  210.  
  211. #  Usando o cache do navegador!
  212. # <IfModule mod_expires.c>
  213. # ExpiresActive On
  214. # ExpiresByType image/jpg "access 1 year"
  215. # ExpiresByType image/jpeg "access 1 year"
  216. # ExpiresByType image/gif "access 1 year"
  217. # ExpiresByType image/png "access 1 year"
  218. # ExpiresByType text/css "access 1 month"
  219. # ExpiresByType application/pdf "access 1 month"
  220. # ExpiresByType text/x‐javascript "access 1 month"
  221. # ExpiresByType application/x‐shockwave‐flash "access 1 month"
  222. # ExpiresByType image/x‐icon "access 1 year"
  223. # ExpiresDefault "access 2 days"
  224. # </IfModule>
  225.  
  226. # Forçando downloads de determinados tipos de arquivos!
  227. AddType application/octet‐stream .pdf
  228. AddType application/octet‐stream .avi
  229. AddType application/octet‐stream .xls
  230. AddType application/octet‐stream .txt
  231. AddType application/octet‐stream .mp3
  232. AddType application/octet‐stream .jpg
  233. AddType application/octet‐stream .vcf
  234. AddType application/octet‐stream .tar
  235. AddType application/octet‐stream .gz
  236.  
  237. # Protegendo wp-config.php!
  238. <files wp-config.php>
  239. order allow,deny
  240. deny from all
  241. </files>
  242.  
  243. <Files 403.shtml>
  244. order allow,deny
  245. allow from all
  246. </Files>
  247.  
  248. # protect xmlrpc
  249. <Files xmlrpc.php>
  250.   Order Deny,Allow
  251.   Deny from all
  252. </Files>
  253.  
  254. # protect xmlrpc
  255. <IfModule mod_alias.c>
  256.   RedirectMatch 403 /xmlrpc.php
  257. </IfModule>
  258.  
  259. # Block the include-only files.
  260. RewriteEngine On
  261. RewriteBase /
  262. RewriteRule ^wp-admin/includes/ - [F,L]
  263. RewriteRule !^wp-includes/ - [S=3]
  264. RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
  265. RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
  266. RewriteRule ^wp-includes/theme-compat/ - [F,L]
  267.  
  268.  
  269. order deny,allow
  270. Options All -Indexes
  271. order allow,deny
  272. allow from all
  273.  
  274. # Force HTTPS
  275. RewriteEngine On
  276. RewriteCond %{HTTPS} off
  277. RewriteRule (.*) https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  278.  
  279. # Protegendo wp-login wp-admin admin !
  280. <IfModule mod_rewrite.c>
  281.    RewriteEngine On
  282.    RewriteBase /
  283.    RewriteCond %{REQUEST_URI} wp-login wp-admin admin
  284.    RewriteCond %{HTTP_COOKIE} !site-admin-of-allow-wp-login=142c1f34-eb75-4d26-bbc3-39fcb1d0c719
  285.    RewriteRule . - [F]
  286. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement