Advertisement
kartick

htaccess content

Oct 16th, 2022
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.84 KB | None | 0 0
  1. RewriteEngine On
  2.  
  3. RewriteRule . /public/index.php [L]
  4. RewriteCond %{REQUEST_FILENAME} !-d
  5. RewriteCond %{REQUEST_FILENAME} !-f
  6.  
  7. #Disable index view
  8. options -Indexes
  9.  
  10. #hide a Specifuc File
  11. <Files .env>
  12. order allow,deny
  13. Deny from all
  14. </Files>
  15.  
  16. <Files .env.example>
  17. order allow,deny
  18. Deny from all
  19. </Files>
  20.  
  21. <Files _ide_helper.php>
  22. order allow,deny
  23. Deny from all
  24. </Files>
  25.  
  26. <IfModule mod_rewrite.c>
  27. <IfModule mod_negotiation.c>
  28. Options -MultiViews -Indexes
  29. </IfModule>
  30.  
  31. RewriteEngine On
  32.  
  33. # Handle Authorization Header
  34. RewriteCond %{HTTP:Authorization} .
  35. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  36.  
  37. # Redirect Trailing Slashes If Not A Folder...
  38. RewriteCond %{REQUEST_FILENAME} !-d
  39. RewriteCond %{REQUEST_URI} (.+)/$
  40. RewriteRule ^ %1 [L,R=301]
  41.  
  42. # Send Requests To Front Controller...
  43. RewriteCond %{REQUEST_FILENAME} !-d
  44. RewriteCond %{REQUEST_FILENAME} !-f
  45. RewriteRule ^ index.php [L]
  46. </IfModule>
  47.  
  48. <IfModule mod_expires.c>
  49. ## Enable expiration control
  50. ExpiresActive On
  51.  
  52. ## CSS and JS expiration: 1 week after request
  53. ExpiresByType text/css "now plus 1 week"
  54. ExpiresByType application/javascript "now plus 1 week"
  55. ExpiresByType application/x-javascript "now plus 1 week"
  56.  
  57. ## Image files expiration: 1 month after request
  58. ExpiresByType image/bmp "now plus 1 month"
  59. ExpiresByType image/gif "now plus 1 month"
  60. ExpiresByType image/jpeg "now plus 1 month"
  61. ExpiresByType image/jp2 "now plus 1 month"
  62. ExpiresByType image/pipeg "now plus 1 month"
  63. ExpiresByType image/png "now plus 1 month"
  64. ExpiresByType image/svg+xml "now plus 1 month"
  65. ExpiresByType image/tiff "now plus 1 month"
  66. ExpiresByType image/x-icon "now plus 1 month"
  67. ExpiresByType image/ico "now plus 1 month"
  68. ExpiresByType image/icon "now plus 1 month"
  69. ExpiresByType text/ico "now plus 1 month"
  70. ExpiresByType application/ico "now plus 1 month"
  71. ExpiresByType image/vnd.wap.wbmp "now plus 1 month"
  72.  
  73. ## Font files expiration: 1 week after request
  74. ExpiresByType application/x-font-ttf "now plus 1 week"
  75. ExpiresByType application/x-font-opentype "now plus 1 week"
  76. ExpiresByType application/x-font-woff "now plus 1 week"
  77. ExpiresByType font/woff2 "now plus 1 week"
  78. ExpiresByType image/svg+xml "now plus 1 week"
  79.  
  80. ## Audio files expiration: 1 month after request
  81. ExpiresByType audio/ogg "now plus 1 month"
  82. ExpiresByType application/ogg "now plus 1 month"
  83. ExpiresByType audio/basic "now plus 1 month"
  84. ExpiresByType audio/mid "now plus 1 month"
  85. ExpiresByType audio/midi "now plus 1 month"
  86. ExpiresByType audio/mpeg "now plus 1 month"
  87. ExpiresByType audio/mp3 "now plus 1 month"
  88. ExpiresByType audio/x-aiff "now plus 1 month"
  89. ExpiresByType audio/x-mpegurl "now plus 1 month"
  90. ExpiresByType audio/x-pn-realaudio "now plus 1 month"
  91. ExpiresByType audio/x-wav "now plus 1 month"
  92.  
  93. ## Movie files expiration: 1 month after request
  94. ExpiresByType application/x-shockwave-flash "now plus 1 month"
  95. ExpiresByType x-world/x-vrml "now plus 1 month"
  96. ExpiresByType video/x-msvideo "now plus 1 month"
  97. ExpiresByType video/mpeg "now plus 1 month"
  98. ExpiresByType video/mp4 "now plus 1 month"
  99. ExpiresByType video/quicktime "now plus 1 month"
  100. ExpiresByType video/x-la-asf "now plus 1 month"
  101. ExpiresByType video/x-ms-asf "now plus 1 month"
  102. </IfModule>
  103.  
  104. <ifModule mod_gzip.c>
  105. mod_gzip_on Yes
  106. mod_gzip_dechunk Yes
  107. mod_gzip_item_include file .(html?|txt|css|js|php)$
  108. mod_gzip_item_include handler ^cgi-script$
  109. mod_gzip_item_include mime ^text/.*
  110. mod_gzip_item_include mime ^application/x-javascript.*
  111. mod_gzip_item_exclude mime ^image/.*
  112. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  113. </ifModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement