dimaslanjaka

better htaccess wp

Apr 3rd, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. # BEGIN WordPress
  2. <IfModule mod_rewrite.c>
  3. RewriteEngine On
  4. RewriteBase /
  5. RewriteRule ^index\.php$ - [L]
  6. RewriteCond %{REQUEST_FILENAME} !-f
  7. RewriteCond %{REQUEST_FILENAME} !-d
  8. RewriteRule . /index.php [L]
  9. </IfModule>
  10.  
  11. # END WordPress
  12.  
  13. # WP Super Simple Speed by WP-Superformance.com Starts
  14.  
  15. # Hotlink Protection Start
  16.  
  17. RewriteEngine on
  18. RewriteCond %{HTTP_REFERER} !^$
  19. RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?blog.snfr.cf [NC]
  20. RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
  21. RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
  22.  
  23. # GZIP Compression Start
  24.  
  25. <IfModule mod_deflate.c>
  26. AddOutputFilterByType DEFLATE text/plain
  27. AddOutputFilterByType DEFLATE text/html
  28. AddOutputFilterByType DEFLATE text/xml
  29. AddOutputFilterByType DEFLATE text/css
  30. AddOutputFilterByType DEFLATE application/xml
  31. AddOutputFilterByType DEFLATE application/xhtml+xml
  32. AddOutputFilterByType DEFLATE application/rss+xml
  33. AddOutputFilterByType DEFLATE application/javascript
  34. AddOutputFilterByType DEFLATE application/x-javascript
  35. AddOutputFilterByType DEFLATE application/x-httpd-php
  36. AddOutputFilterByType DEFLATE application/x-httpd-fastphp
  37. AddOutputFilterByType DEFLATE image/svg+xml
  38. BrowserMatch ^Mozilla/4 gzip-only-text/html
  39. BrowserMatch ^Mozilla/4\.0[678] no-gzip
  40. BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
  41. Header append Vary User-Agent env=!dont-vary
  42. </IfModule>
  43.  
  44. # Leverage Browser Caching Start
  45.  
  46. <IfModule mod_expires.c>
  47. ExpiresActive On
  48. ExpiresByType image/jpg "access 1 year"
  49. ExpiresByType image/jpeg "access 1 year"
  50. ExpiresByType image/gif "access 1 year"
  51. ExpiresByType image/png "access 1 year"
  52. ExpiresByType text/css "access 1 month"
  53. ExpiresByType text/html "access 1 month"
  54. ExpiresByType application/pdf "access 1 month"
  55. ExpiresByType text/x-javascript "access 1 month"
  56. ExpiresByType application/x-shockwave-flash "access 1 month"
  57. ExpiresByType image/x-icon "access 1 year"
  58. ExpiresDefault "access 1 month"
  59. </IfModule>
  60.  
  61. # Caching of common files Start
  62.  
  63. <IfModule mod_headers.c>
  64. <FilesMatch "\.(ico|pdf|flv|swf|js|css|gif|png|jpg|jpeg|ico|txt|html|htm)$">
  65. Header set Cache-Control "max-age=2592000, public"
  66. </FilesMatch>
  67. </IfModule>
  68.  
  69. # Enable Keepalive Start
  70.  
  71. <ifModule mod_headers.c>
  72. Header set Connection keep-alive
  73. </ifModule>
  74.  
  75. # Use UTF-8 encoding Start
  76.  
  77. AddDefaultCharset utf-8
  78.  
  79. # Enable Vary: Accept-Encoding Start
  80.  
  81. <IfModule mod_headers.c>
  82. <FilesMatch "\.(js|css|xml|gz)$">
  83. Header append Vary: Accept-Encoding
  84. </FilesMatch>
  85. </IfModule>
  86.  
  87. # WP Super Simple Speed by WP-Superformance.com Ends
Advertisement
Add Comment
Please, Sign In to add comment