Guest User

Untitled

a guest
Sep 20th, 2015
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RewriteEngine on
  2. RewriteCond %{HTTP_REFERER} !^$
  3. RewriteCond %{HTTP_REFERER} !^http://asylum.rocks/.*$ [NC]
  4. RewriteRule \.(gif|jpg|jpeg|bmp)$ – [F]
  5.  
  6. # permanently redirect from www domain to non-www domain
  7. RewriteEngine on
  8. Options +FollowSymLinks
  9. RewriteCond %{HTTP_HOST} ^www\.domain\.tld$ [NC]
  10. RewriteRule ^(.*)$ http://domain.tld/$1 [R=301,L]
  11.  
  12. # preserve bandwidth for PHP enabled servers
  13. <ifmodule mod_php4.c>
  14. php_value zlib.output_compression 16386
  15. </ifmodule>
  16.  
  17. <IfModule mod_rewrite.c>
  18. RewriteEngine On
  19. RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
  20. RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
  21. RewriteCond %{REMOTE_ADDR} !^76\.84\.91\.119$
  22. RewriteRule ^(.*)$ - [R=403,L]
  23. </IfModule>
  24.  
  25. <IfModule mod_rewrite.c>
  26. RewriteEngine on
  27. RewriteCond %{REQUEST_METHOD} POST
  28. RewriteCond %{HTTP_REFERER} !^http://(.*)?asylum\.rocks [NC]
  29. RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
  30. RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
  31. RewriteRule ^(.*)$ - [F]
  32. </IfModule>
  33.  
  34. # Block the include-only files.
  35. <IfModule mod_rewrite.c>
  36. RewriteEngine On
  37. RewriteBase /
  38. RewriteRule ^wp-admin/includes/ - [F,L]
  39. RewriteRule !^wp-includes/ - [S=3]
  40. RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
  41. RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
  42. RewriteRule ^wp-includes/theme-compat/ - [F,L]
  43. </IfModule>
  44.  
  45. # BEGIN WordPress
  46. <IfModule mod_rewrite.c>
  47. RewriteEngine On
  48. RewriteBase /
  49. RewriteCond %{REQUEST_FILENAME} !-f
  50. RewriteCond %{REQUEST_FILENAME} !-d
  51. RewriteRule ^([^?]*)$ /index.php [NC,L,QSA]
  52. </IfModule>
  53. # END WordPress
  54.  
  55. RewriteEngine On
  56. RewriteCond %{SCRIPT_FILENAME} !-d
  57. RewriteRule ^([^.]+)$ $1.php [NC,L]
  58.  
  59. RewriteCond %{SCRIPT_FILENAME} -d [OR]
  60. RewriteCond %{SCRIPT_FILENAME} -f
  61. RewriteRule "(^|/)\." - [F]
  62.  
  63. RedirectMatch 404 /\..*$
  64.  
  65. Options All -Indexes
  66.  
  67. <IfModule mod_deflate.c>
  68.  
  69. # Force compression for mangled headers.
  70. # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
  71. <IfModule mod_setenvif.c>
  72. <IfModule mod_headers.c>
  73. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  74. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  75. </IfModule>
  76. </IfModule>
  77.  
  78. # Compress all output labeled with one of the following MIME-types
  79. # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
  80. # and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines
  81. # as `AddOutputFilterByType` is still in the core directives).
  82. <IfModule mod_filter.c>
  83. AddOutputFilterByType DEFLATE application/atom+xml \
  84. application/javascript \
  85. application/json \
  86. application/rss+xml \
  87. application/vnd.ms-fontobject \
  88. application/x-font-ttf \
  89. application/x-web-app-manifest+json \
  90. application/xhtml+xml \
  91. application/xml \
  92. font/opentype \
  93. image/svg+xml \
  94. image/x-icon \
  95. text/css \
  96. text/html \
  97. text/plain \
  98. text/x-component \
  99. text/xml
  100. </IfModule>
  101.  
  102. </IfModule>
  103.  
  104. <IfModule mod_expires.c>
  105. ExpiresActive on
  106. ExpiresDefault "access plus 1 month"
  107.  
  108. # CSS
  109. ExpiresByType text/css "access plus 1 year"
  110.  
  111. # Data interchange
  112. ExpiresByType application/json "access plus 0 seconds"
  113. ExpiresByType application/xml "access plus 0 seconds"
  114. ExpiresByType text/xml "access plus 0 seconds"
  115.  
  116. # Favicon (cannot be renamed!)
  117. ExpiresByType image/x-icon "access plus 1 week"
  118.  
  119. # HTML components (HTCs)
  120. ExpiresByType text/x-component "access plus 1 month"
  121.  
  122. # HTML
  123. ExpiresByType text/html "access plus 0 seconds"
  124.  
  125. # JavaScript
  126. ExpiresByType application/javascript "access plus 1 year"
  127.  
  128. # Manifest files
  129. ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
  130. ExpiresByType text/cache-manifest "access plus 0 seconds"
  131.  
  132. # Media
  133. ExpiresByType audio/ogg "access plus 1 month"
  134. ExpiresByType image/gif "access plus 1 month"
  135. ExpiresByType image/jpeg "access plus 1 month"
  136. ExpiresByType image/png "access plus 1 month"
  137. ExpiresByType video/mp4 "access plus 1 month"
  138. ExpiresByType video/ogg "access plus 1 month"
  139. ExpiresByType video/webm "access plus 1 month"
  140.  
  141. # Web feeds
  142. ExpiresByType application/atom+xml "access plus 1 hour"
  143. ExpiresByType application/rss+xml "access plus 1 hour"
  144.  
  145. # Web fonts
  146. ExpiresByType application/font-woff2 "access plus 1 month"
  147. ExpiresByType application/font-woff "access plus 1 month"
  148. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  149. ExpiresByType application/x-font-ttf "access plus 1 month"
  150. ExpiresByType font/opentype "access plus 1 month"
  151. ExpiresByType image/svg+xml "access plus 1 month"
  152. </IfModule>
  153.  
  154. <IfModule mod_headers.c>
  155. Header unset ETag
  156. </IfModule>
  157. FileETag None
  158.  
  159. <IfModule mod_headers.c>
  160. <FilesMatch "\.(eot|otf|ttc|ttf|woff|woff2)$">
  161. Header set Access-Control-Allow-Origin "*"
  162. </FilesMatch>
  163. </IfModule>
  164.  
  165. SetEnv TZ America/Chicago
  166.  
  167. DefaultLanguage en-US
  168.  
  169. # CDN
  170. <If "%{HTTP_HOST} == 'asylum.rocks' ">
  171. RedirectMatch ^/imgs/(.*)$ http://imgs.asylum.rocks/$1
  172. </If>
  173.  
  174. # BEGIN W3TC Browser Cache
  175. <IfModule mod_mime.c>
  176. AddType text/css .css
  177. AddType text/x-component .htc
  178. AddType application/x-javascript .js
  179. AddType application/javascript .js2
  180. AddType text/javascript .js3
  181. AddType text/x-js .js4
  182. AddType text/html .html .htm
  183. AddType text/richtext .rtf .rtx
  184. AddType image/svg+xml .svg .svgz
  185. AddType text/plain .txt
  186. AddType text/xsd .xsd
  187. AddType text/xsl .xsl
  188. AddType text/xml .xml
  189. AddType video/asf .asf .asx .wax .wmv .wmx
  190. AddType video/avi .avi
  191. AddType image/bmp .bmp
  192. AddType application/java .class
  193. AddType video/divx .divx
  194. AddType application/msword .doc .docx
  195. AddType application/vnd.ms-fontobject .eot
  196. AddType application/x-msdownload .exe
  197. AddType image/gif .gif
  198. AddType application/x-gzip .gz .gzip
  199. AddType image/x-icon .ico
  200. AddType image/jpeg .jpg .jpeg .jpe
  201. AddType application/json .json
  202. AddType application/vnd.ms-access .mdb
  203. AddType audio/midi .mid .midi
  204. AddType video/quicktime .mov .qt
  205. AddType audio/mpeg .mp3 .m4a
  206. AddType video/mp4 .mp4 .m4v
  207. AddType video/mpeg .mpeg .mpg .mpe
  208. AddType application/vnd.ms-project .mpp
  209. AddType application/x-font-otf .otf
  210. AddType application/vnd.ms-opentype .otf
  211. AddType application/vnd.oasis.opendocument.database .odb
  212. AddType application/vnd.oasis.opendocument.chart .odc
  213. AddType application/vnd.oasis.opendocument.formula .odf
  214. AddType application/vnd.oasis.opendocument.graphics .odg
  215. AddType application/vnd.oasis.opendocument.presentation .odp
  216. AddType application/vnd.oasis.opendocument.spreadsheet .ods
  217. AddType application/vnd.oasis.opendocument.text .odt
  218. AddType audio/ogg .ogg
  219. AddType application/pdf .pdf
  220. AddType image/png .png
  221. AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
  222. AddType audio/x-realaudio .ra .ram
  223. AddType application/x-shockwave-flash .swf
  224. AddType application/x-tar .tar
  225. AddType image/tiff .tif .tiff
  226. AddType application/x-font-ttf .ttf .ttc
  227. AddType application/vnd.ms-opentype .ttf .ttc
  228. AddType audio/wav .wav
  229. AddType audio/wma .wma
  230. AddType application/vnd.ms-write .wri
  231. AddType application/font-woff .woff
  232. AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
  233. AddType application/zip .zip
  234. </IfModule>
  235. <IfModule mod_expires.c>
  236. ExpiresActive On
  237. ExpiresByType text/css A31536000
  238. ExpiresByType text/x-component A31536000
  239. ExpiresByType application/x-javascript A31536000
  240. ExpiresByType application/javascript A31536000
  241. ExpiresByType text/javascript A31536000
  242. ExpiresByType text/x-js A31536000
  243. ExpiresByType text/html A3600
  244. ExpiresByType text/richtext A3600
  245. ExpiresByType image/svg+xml A3600
  246. ExpiresByType text/plain A3600
  247. ExpiresByType text/xsd A3600
  248. ExpiresByType text/xsl A3600
  249. ExpiresByType text/xml A3600
  250. ExpiresByType video/asf A31536000
  251. ExpiresByType video/avi A31536000
  252. ExpiresByType image/bmp A31536000
  253. ExpiresByType application/java A31536000
  254. ExpiresByType video/divx A31536000
  255. ExpiresByType application/msword A31536000
  256. ExpiresByType application/vnd.ms-fontobject A31536000
  257. ExpiresByType application/x-msdownload A31536000
  258. ExpiresByType image/gif A31536000
  259. ExpiresByType application/x-gzip A31536000
  260. ExpiresByType image/x-icon A31536000
  261. ExpiresByType image/jpeg A31536000
  262. ExpiresByType application/json A31536000
  263. ExpiresByType application/vnd.ms-access A31536000
  264. ExpiresByType audio/midi A31536000
  265. ExpiresByType video/quicktime A31536000
  266. ExpiresByType audio/mpeg A31536000
  267. ExpiresByType video/mp4 A31536000
  268. ExpiresByType video/mpeg A31536000
  269. ExpiresByType application/vnd.ms-project A31536000
  270. ExpiresByType application/x-font-otf A31536000
  271. ExpiresByType application/vnd.ms-opentype A31536000
  272. ExpiresByType application/vnd.oasis.opendocument.database A31536000
  273. ExpiresByType application/vnd.oasis.opendocument.chart A31536000
  274. ExpiresByType application/vnd.oasis.opendocument.formula A31536000
  275. ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
  276. ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
  277. ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
  278. ExpiresByType application/vnd.oasis.opendocument.text A31536000
  279. ExpiresByType audio/ogg A31536000
  280. ExpiresByType application/pdf A31536000
  281. ExpiresByType image/png A31536000
  282. ExpiresByType application/vnd.ms-powerpoint A31536000
  283. ExpiresByType audio/x-realaudio A31536000
  284. ExpiresByType image/svg+xml A31536000
  285. ExpiresByType application/x-shockwave-flash A31536000
  286. ExpiresByType application/x-tar A31536000
  287. ExpiresByType image/tiff A31536000
  288. ExpiresByType application/x-font-ttf A31536000
  289. ExpiresByType application/vnd.ms-opentype A31536000
  290. ExpiresByType audio/wav A31536000
  291. ExpiresByType audio/wma A31536000
  292. ExpiresByType application/vnd.ms-write A31536000
  293. ExpiresByType application/font-woff A31536000
  294. ExpiresByType application/vnd.ms-excel A31536000
  295. ExpiresByType application/zip A31536000
  296. </IfModule>
  297. <IfModule mod_deflate.c>
  298. <IfModule mod_headers.c>
  299. Header append Vary User-Agent env=!dont-vary
  300. </IfModule>
  301. <IfModule mod_filter.c>
  302. 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/x-icon application/json
  303. <IfModule mod_mime.c>
  304. # DEFLATE by extension
  305. AddOutputFilter DEFLATE js css htm html xml
  306. </IfModule>
  307. </IfModule>
  308. </IfModule>
  309. <FilesMatch "\.(css|htc|less|js|js2|js3|js4|CSS|HTC|LESS|JS|JS2|JS3|JS4)$">
  310. FileETag MTime Size
  311. <IfModule mod_headers.c>
  312. Header set Pragma "public"
  313. Header append Cache-Control "public"
  314. </IfModule>
  315. </FilesMatch>
  316. <FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|XML)$">
  317. FileETag MTime Size
  318. <IfModule mod_headers.c>
  319. Header set Pragma "public"
  320. Header append Cache-Control "public"
  321. </IfModule>
  322. </FilesMatch>
  323. <FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|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|wav|wma|wri|woff|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|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|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|WAV|WMA|WRI|WOFF|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
  324. FileETag MTime Size
  325. <IfModule mod_headers.c>
  326. Header set Pragma "public"
  327. Header append Cache-Control "public"
  328. Header unset Set-Cookie
  329. </IfModule>
  330. </FilesMatch>
  331. # END W3TC Browser Cache
  332.  
  333. # BEGIN W3TC Page Cache core
  334. <IfModule mod_rewrite.c>
  335. RewriteEngine On
  336. RewriteBase /
  337. RewriteCond %{HTTP:Accept-Encoding} gzip
  338. RewriteRule .* - [E=W3TC_ENC:_gzip]
  339. RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
  340. RewriteRule .* - [E=W3TC_PREVIEW:_preview]
  341. RewriteCond %{REQUEST_METHOD} !=POST
  342. RewriteCond %{QUERY_STRING} =""
  343. RewriteCond %{REQUEST_URI} \/$
  344. RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
  345. RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
  346. RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
  347. </IfModule>
  348. # END W3TC Page Cache core
RAW Paste Data