israel5ew

WooCommerce .htaccess

Sep 2nd, 2025
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.52 KB | Source Code | 0 0
  1. # SGS XMLRPC Disable Service
  2. <Files xmlrpc.php>
  3. order deny,allow
  4. deny from all
  5. </Files>
  6. # SGS XMLRPC Disable Service END
  7. # BEGIN WP Rocket
  8. # Use UTF-8 encoding for anything served text/plain or text/html
  9. AddDefaultCharset UTF-8
  10. # Force UTF-8 for a number of file formats
  11. <IfModule mod_mime.c>
  12. AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml
  13. </IfModule>
  14.  
  15. # FileETag None is not enough for every server.
  16. <IfModule mod_headers.c>
  17. Header unset ETag
  18. </IfModule>
  19.  
  20. # Since we’re sending far-future expires, we don’t need ETags for static content.
  21. # developer.yahoo.com/performance/rules.html#etags
  22. FileETag None
  23.  
  24. <IfModule mod_alias.c>
  25. <FilesMatch "\.(html|htm|rtf|rtx|txt|xsd|xsl|xml)$">
  26. <IfModule mod_headers.c>
  27. Header set X-Powered-By "WP Rocket/3.19.4"
  28. Header unset Pragma
  29. Header append Cache-Control "public"
  30. Header unset Last-Modified
  31. </IfModule>
  32. </FilesMatch>
  33.  
  34. <FilesMatch "\.(css|htc|js|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|xla|xls|xlsx|xlt|xlw|zip)$">
  35. <IfModule mod_headers.c>
  36. Header unset Pragma
  37. Header append Cache-Control "public"
  38. </IfModule>
  39. </FilesMatch>
  40. </IfModule>
  41.  
  42. <IfModule mod_mime.c>
  43. AddType image/avif avif
  44. AddType image/avif-sequence avifs
  45. </IfModule>
  46. # Expires headers (for better cache control)
  47. <IfModule mod_expires.c>
  48. ExpiresActive on
  49. ExpiresDefault "access plus 1 month"
  50. # cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
  51. ExpiresByType text/cache-manifest "access plus 0 seconds"
  52. # Your document html
  53. ExpiresByType text/html "access plus 0 seconds"
  54. # Data
  55. ExpiresByType text/xml "access plus 0 seconds"
  56. ExpiresByType application/xml "access plus 0 seconds"
  57. ExpiresByType application/json "access plus 0 seconds"
  58. # Feed
  59. ExpiresByType application/rss+xml "access plus 1 hour"
  60. ExpiresByType application/atom+xml "access plus 1 hour"
  61. # Favicon (cannot be renamed)
  62. ExpiresByType image/x-icon "access plus 1 week"
  63. # Media: images, video, audio
  64. ExpiresByType image/gif "access plus 4 months"
  65. ExpiresByType image/png "access plus 4 months"
  66. ExpiresByType image/jpeg "access plus 4 months"
  67. ExpiresByType image/webp "access plus 4 months"
  68. ExpiresByType video/ogg "access plus 4 months"
  69. ExpiresByType audio/ogg "access plus 4 months"
  70. ExpiresByType video/mp4 "access plus 4 months"
  71. ExpiresByType video/webm "access plus 4 months"
  72. ExpiresByType image/avif "access plus 4 months"
  73. ExpiresByType image/avif-sequence "access plus 4 months"
  74. # HTC files (css3pie)
  75. ExpiresByType text/x-component "access plus 1 month"
  76. # Webfonts
  77. ExpiresByType font/ttf "access plus 4 months"
  78. ExpiresByType font/otf "access plus 4 months"
  79. ExpiresByType font/woff "access plus 4 months"
  80. ExpiresByType font/woff2 "access plus 4 months"
  81. ExpiresByType image/svg+xml "access plus 4 months"
  82. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  83. # CSS and JavaScript
  84. ExpiresByType text/css "access plus 1 year"
  85. ExpiresByType application/javascript "access plus 1 year"
  86. </IfModule>
  87. # Gzip compression
  88. <IfModule mod_deflate.c>
  89. # Active compression
  90. SetOutputFilter DEFLATE
  91. # Force deflate for mangled headers
  92. <IfModule mod_setenvif.c>
  93. <IfModule mod_headers.c>
  94. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  95. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  96. # Don’t compress images and other uncompressible content
  97. SetEnvIfNoCase Request_URI \
  98. \.(?:gif|jpe?g|png|rar|zip|exe|flv|mov|wma|mp3|avi|swf|mp?g|mp4|webm|webp|pdf)$ no-gzip dont-vary
  99. </IfModule>
  100. </IfModule>
  101.  
  102. # Compress all output labeled with one of the following MIME-types
  103. <IfModule mod_filter.c>
  104. AddOutputFilterByType DEFLATE application/atom+xml \
  105. application/javascript \
  106. application/json \
  107. application/rss+xml \
  108. application/vnd.ms-fontobject \
  109. application/x-font-ttf \
  110. application/xhtml+xml \
  111. application/xml \
  112. font/opentype \
  113. image/svg+xml \
  114. image/x-icon \
  115. text/css \
  116. text/html \
  117. text/plain \
  118. text/x-component \
  119. text/xml
  120. </IfModule>
  121. <IfModule mod_headers.c>
  122. Header append Vary: Accept-Encoding
  123. </IfModule>
  124. </IfModule>
  125.  
  126.  
  127. # END WP Rocket
  128. # This file was updated by Duplicator Pro on 2025-06-18 05:38:33.
  129. # See the original_files_ folder for the original source_site_htaccess file.
  130.  
  131. # ----------------------------------------------------------------------
  132. # Allow Only Verified Search Engine Bots (Google, Bing, etc.)
  133. # Block All Bad & Unknown Bots
  134. # ----------------------------------------------------------------------
  135. <IfModule mod_rewrite.c>
  136. RewriteEngine On
  137.  
  138. # ===== WHHITELIST IP ADDRESS =====
  139. <RequireAny>
  140. # IPv4
  141. Require ip 72.14.177.223
  142. Require ip 96.126.114.141
  143. Require ip 45.33.27.6
  144. Require ip 45.79.34.198
  145. Require ip 50.116.21.133
  146. Require ip 45.33.127.225
  147. Require ip 45.79.40.138
  148. Require ip 45.79.21.85
  149.  
  150. # IPv6
  151. Require ip 2600:3c00::f03c:95ff:fe0a:5ecf
  152. Require ip 2600:3c00::f03c:92ff:feee:7fdf
  153. Require ip 2600:3c00::f03c:93ff:fe80:ade8
  154. Require ip 2600:3c00::f03c:93ff:fea9:2e9f
  155. Require ip 2600:3c00::f03c:93ff:fe37:d535
  156. Require ip 2600:3c00::f03c:94ff:fea7:b1e1
  157. Require ip 2600:3c00::f03c:94ff:fef9:4cc4
  158. Require ip 2600:3c00::f03c:94ff:fee6:85c0
  159. </RequireAny>
  160.  
  161. # ===== ALLOW GOOGLEBOTS =====
  162. RewriteCond %{HTTP_USER_AGENT} Googlebot [NC]
  163. RewriteCond %{REMOTE_ADDR} ^66\.249\. [OR]
  164. RewriteCond %{REMOTE_ADDR} ^64\.233\. [OR]
  165. RewriteCond %{REMOTE_ADDR} ^72\.14\. [OR]
  166. RewriteCond %{REMOTE_ADDR} ^203\.208\. [OR]
  167. RewriteCond %{REMOTE_ADDR} ^216\.239\. [OR]
  168. RewriteCond %{REMOTE_ADDR} ^209\.85\.
  169. RewriteRule .* - [L]
  170.  
  171. # ===== ALLOW BINGBOTS =====
  172. RewriteCond %{HTTP_USER_AGENT} Bingbot [NC]
  173. RewriteCond %{REMOTE_ADDR} ^13\.66\. [OR]
  174. RewriteCond %{REMOTE_ADDR} ^13\.67\. [OR]
  175. RewriteCond %{REMOTE_ADDR} ^13\.68\. [OR]
  176. RewriteCond %{REMOTE_ADDR} ^13\.69\. [OR]
  177. RewriteCond %{REMOTE_ADDR} ^40\.77\. [OR]
  178. RewriteCond %{REMOTE_ADDR} ^52\.167\. [OR]
  179. RewriteCond %{REMOTE_ADDR} ^157\.55\. [OR]
  180. RewriteCond %{REMOTE_ADDR} ^157\.56\. [OR]
  181. RewriteCond %{REMOTE_ADDR} ^207\.46\.
  182. RewriteRule .* - [L]
  183.  
  184. # ===== ALLOW OTHER GOOD BOTS =====
  185. RewriteCond %{HTTP_USER_AGENT} (Googlebot-Image|Googlebot-News|Googlebot-Video|Slurp|DuckDuckBot|Applebot|FacebookExternalHit|Twitterbot|LinkedInBot) [NC]
  186. RewriteRule .* - [L]
  187.  
  188. # ===== BLOCK BAD BOTS =====
  189. RewriteCond %{HTTP_USER_AGENT} (AhrefsBot|SemrushBot|MJ12bot|DotBot|SEOkicks-Robot|BLEXBot|MegaIndex|LinkpadBot|Exabot|archive\.org_bot|SeznamBot|HTTrack|wget|curl|Python-requests|urllib|Scrapy|java|libwww-perl|WPScan|ZmEu|nikto|sqlmap) [NC]
  190. RewriteRule .* - [F,L]
  191.  
  192. # ===== BLOCK ALL OTHER UNKNOWN BOTS =====
  193. RewriteCond %{HTTP_USER_AGENT} !^$
  194. RewriteCond %{HTTP_USER_AGENT} !Mozilla [NC] # Allows normal browsers (Chrome, Safari, Firefox, Edge)
  195. RewriteRule .* - [F,L]
  196.  
  197. </IfModule>
  198.  
  199. # BEGIN WordPress
  200. # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
  201. # dynamically generated, and should only be modified via WordPress filters.
  202. # Any changes to the directives between these markers will be overwritten.
  203. <IfModule mod_rewrite.c>
  204. RewriteEngine On
  205. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  206. RewriteBase /
  207. RewriteRule ^index\.php$ - [L]
  208. RewriteCond %{REQUEST_FILENAME} !-f
  209. RewriteCond %{REQUEST_FILENAME} !-d
  210. RewriteRule . /index.php [L]
  211. </IfModule>
  212.  
  213. # END WordPress
  214. <IfModule mod_security.c>
  215. SecRuleRemoveById 400011
  216. SecRuleRemoveById 400012
  217. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment