rakeshr

Untitled

Jan 30th, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. htaccess code starts here
  2.  
  3.  
  4. <IfModule mod_deflate.c>
  5. # Compress HTML, CSS, JavaScript, Text, XML and fonts
  6. AddOutputFilterByType DEFLATE application/javascript
  7. AddOutputFilterByType DEFLATE application/rss+xml
  8. AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  9. AddOutputFilterByType DEFLATE application/x-font
  10. AddOutputFilterByType DEFLATE application/x-font-opentype
  11. AddOutputFilterByType DEFLATE application/x-font-otf
  12. AddOutputFilterByType DEFLATE application/x-font-truetype
  13. AddOutputFilterByType DEFLATE application/x-font-ttf
  14. AddOutputFilterByType DEFLATE application/x-javascript
  15. AddOutputFilterByType DEFLATE application/xhtml+xml
  16. AddOutputFilterByType DEFLATE application/xml
  17. AddOutputFilterByType DEFLATE font/opentype
  18. AddOutputFilterByType DEFLATE font/otf
  19. AddOutputFilterByType DEFLATE font/ttf
  20. AddOutputFilterByType DEFLATE image/svg+xml
  21. AddOutputFilterByType DEFLATE image/x-icon
  22. AddOutputFilterByType DEFLATE text/css
  23. AddOutputFilterByType DEFLATE text/html
  24. AddOutputFilterByType DEFLATE text/javascript
  25. AddOutputFilterByType DEFLATE text/plain
  26. AddOutputFilterByType DEFLATE text/xml
  27.  
  28. # Remove browser bugs (only needed for really old browsers)
  29. BrowserMatch ^Mozilla/4 gzip-only-text/html
  30. BrowserMatch ^Mozilla/4\.0[678] no-gzip
  31. BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  32. Header append Vary User-Agent
  33. </IfModule>
  34.  
  35. ExpiresActive On
  36. ExpiresByType image/jpg "access plus 1 year"
  37. ExpiresByType image/jpeg "access plus 1 year"
  38. ExpiresByType image/gif "access plus 1 year"
  39. ExpiresByType image/png "access plus 1 year"
  40. ExpiresByType text/css "access plus 1 month"
  41. ExpiresByType application/pdf "access plus 1 month"
  42. ExpiresByType text/x-javascript "access plus 1 month"
  43. ExpiresByType application/x-shockwave-flash "access plus 1 month"
  44. ExpiresByType image/x-icon "access plus 1 year"
  45. ExpiresDefault "access plus 2 days"
  46.  
  47.  
  48. AddDefaultCharset UTF-8
  49.  
  50.  
  51. <IfModule mod_expires.c>
  52. ExpiresActive On
  53. ExpiresDefault "access plus 1 year"
  54. </IfModule>
  55.  
  56.  
  57. <IfModule mod_headers.c>
  58. <FilesMatch "\.(bmp|css|flv|gif|ico|jpg|jpeg|js|pdf|png|svg|swf|tif|tiff)$">
  59. Header set Last-Modified "Mon, 31 March 20013 00:00:00 GMT"
  60. Header unset ETag
  61. FileETag None
  62. </FilesMatch>
  63. </IfModule>
  64.  
  65.  
  66. /* htaccess code ends here */
  67.  
  68.  
  69. /* functions.php codes starts here */
  70.  
  71.  
  72.  
  73. function _remove_query_strings_1( $src ){
  74. $rqs = explode( '?ver', $src );
  75. return $rqs[0];
  76. }
  77. function _remove_query_strings_2( $src ){
  78. $rqs = explode( '&ver', $src );
  79. return $rqs[0];
  80. }
  81. add_filter( 'script_loader_src', '_remove_query_strings_1', 15, 1 );
  82. add_filter( 'style_loader_src', '_remove_query_strings_1', 15, 1 );
  83. add_filter( 'script_loader_src', '_remove_query_strings_2', 15, 1 );
  84. add_filter( 'style_loader_src', '_remove_query_strings_2', 15, 1 );
  85.  
  86.  
  87. /* functions.php codes ends here */
Add Comment
Please, Sign In to add comment