Advertisement
icorrelate

Htaccess

Jun 15th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. <IfModule mod_rewrite.c>
  2. <IfModule mod_negotiation.c>
  3. Options -MultiViews -Indexes
  4. </IfModule>
  5.  
  6. RewriteEngine On
  7.  
  8. # Handle Authorization Header
  9. RewriteCond %{HTTP:Authorization} .
  10. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  11.  
  12. # Redirect Trailing Slashes If Not A Folder...
  13. RewriteCond %{REQUEST_FILENAME} !-d
  14. RewriteCond %{REQUEST_URI} (.+)/$
  15. RewriteRule ^ %1 [L,R=301]
  16.  
  17. # Handle Front Controller...
  18. RewriteCond %{REQUEST_FILENAME} !-d
  19. RewriteCond %{REQUEST_FILENAME} !-f
  20. RewriteRule ^ index.php [L]
  21. </IfModule>
  22.  
  23.  
  24. Options -Indexes
  25. <ifmodule mod_expires.c>
  26. <Filesmatch "\.(jpg|JPG|jpeg|png|PNG|gif|js|css|swf|ico|woff|mp3)$">
  27. ExpiresActive on
  28. ExpiresDefault "access plus 1 year"
  29. Header append Vary: Accept-Encoding
  30. </Filesmatch>
  31. </ifmodule>
  32.  
  33. <IfModule mod_expires.c>
  34. ExpiresActive On
  35. ExpiresDefault "access plus 1 year"
  36. </IfModule>
  37.  
  38. <IfModule mod_headers.c>
  39. <FilesMatch "\.(bmp|css|flv|gif|ico|jpg|jpeg|js|pdf|png|svg|swf|tif|tiff)$">
  40. Header set Last-Modified "Mon, 31 Aug 2009 00:00:00 GMT"
  41. </FilesMatch>
  42. </IfModule>
  43.  
  44. #Gzip
  45. <ifmodule mod_deflate.c>
  46. AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x- javascript application/javascript
  47. </ifmodule>
  48. #End Gzip
  49.  
  50. <ifModule mod_gzip.c>
  51. mod_gzip_on Yes
  52. mod_gzip_dechunk Yes
  53. mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
  54. mod_gzip_item_include handler ^cgi-script$
  55. mod_gzip_item_include mime ^text/.*
  56. mod_gzip_item_include mime ^application/x-javascript.*
  57. mod_gzip_item_exclude mime ^image/.*
  58. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  59. </ifModule>
  60.  
  61.  
  62. ## EXPIRES CACHING ##
  63. <IfModule mod_expires.c>
  64. ExpiresActive On
  65. ExpiresByType image/jpg "access 1 year"
  66. ExpiresByType image/jpeg "access 1 year"
  67. ExpiresByType image/gif "access 1 year"
  68. ExpiresByType image/png "access 1 year"
  69. ExpiresByType text/css "access 1 month"
  70. ExpiresByType text/html "access 1 month"
  71. ExpiresByType application/pdf "access 1 month"
  72. ExpiresByType text/x-javascript "access 1 month"
  73. ExpiresByType application/x-shockwave-flash "access 1 month"
  74. ExpiresByType image/x-icon "access 1 year"
  75. ExpiresDefault "access 1 month"
  76. </IfModule>
  77. ## EXPIRES CACHING ##
  78.  
  79.  
  80. <IfModule mod_rewrite.c>
  81. RewriteCond %{HTTP_USER_AGENT} ^w3af.sourceforge.net [NC,OR]
  82. RewriteCond %{HTTP_USER_AGENT} dirbuster [NC,OR]
  83. RewriteCond %{HTTP_USER_AGENT} nikto [NC,OR]
  84. RewriteCond %{HTTP_USER_AGENT} SF [OR]
  85. RewriteCond %{HTTP_USER_AGENT} sqlmap [NC,OR]
  86. RewriteCond %{HTTP_USER_AGENT} fimap [NC,OR]
  87. RewriteCond %{HTTP_USER_AGENT} nessus [NC,OR]
  88. RewriteCond %{HTTP_USER_AGENT} whatweb [NC,OR]
  89. RewriteCond %{HTTP_USER_AGENT} Openvas [NC,OR]
  90. RewriteCond %{HTTP_USER_AGENT} jbrofuzz [NC,OR]
  91. RewriteCond %{HTTP_USER_AGENT} libwhisker [NC,OR]
  92. RewriteCond %{HTTP_USER_AGENT} webshag [NC,OR]
  93. RewriteCond %{HTTP:Acunetix-Product} ^WVS
  94. RewriteRule ^.* http://127.0.0.1/ [R=301,L]
  95. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement