# BEGIN WP Rocket v3.6.1
# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset UTF-8
# Force UTF-8 for a number of file formats
<IfModule mod_mime.c>
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml
</IfModule>
# FileETag None is not enough for every server.
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
# Since we’re sending far-future expires, we don’t need ETags for static content.
# developer.yahoo.com/performance/rules.html#etags
FileETag None
<IfModule mod_alias.c>
<FilesMatch "\.(html|htm|rtf|rtx|txt|xsd|xsl|xml)$">
<IfModule mod_headers.c>
Header set X-Powered-By "WP Rocket/3.6.1"
Header unset Pragma
Header append Cache-Control "public"
Header unset Last-Modified
</IfModule>
</FilesMatch>
<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)$">
<IfModule mod_headers.c>
Header unset Pragma
Header append Cache-Control "public"
</IfModule>
</FilesMatch>
</IfModule>
# Expires headers (for better cache control)
<IfModule mod_expires.c>
	ExpiresActive on
	# Perhaps better to whitelist expires rules? Perhaps.
	ExpiresDefault                              "access plus 1 month"
	# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
	ExpiresByType text/cache-manifest           "access plus 0 seconds"
	# Your document html
	ExpiresByType text/html                     "access plus 0 seconds"
	# Data
	ExpiresByType text/xml                      "access plus 0 seconds"
	ExpiresByType application/xml               "access plus 0 seconds"
	ExpiresByType application/json              "access plus 0 seconds"
	# Feed
	ExpiresByType application/rss+xml           "access plus 1 hour"
	ExpiresByType application/atom+xml          "access plus 1 hour"
	# Favicon (cannot be renamed)
	ExpiresByType image/x-icon                  "access plus 1 week"
	# Media: images, video, audio
	ExpiresByType image/gif                     "access plus 4 months"
	ExpiresByType image/png                     "access plus 4 months"
	ExpiresByType image/jpeg                    "access plus 4 months"
	ExpiresByType image/webp                    "access plus 4 months"
	ExpiresByType video/ogg                     "access plus 1 month"
	ExpiresByType audio/ogg                     "access plus 1 month"
	ExpiresByType video/mp4                     "access plus 1 month"
	ExpiresByType video/webm                    "access plus 1 month"
	# HTC files  (css3pie)
	ExpiresByType text/x-component              "access plus 1 month"
	# Webfonts
	ExpiresByType font/ttf                      "access plus 4 months"
	ExpiresByType font/otf                      "access plus 4 months"
	ExpiresByType font/woff                     "access plus 4 months"
	ExpiresByType font/woff2                    "access plus 4 months"
	ExpiresByType image/svg+xml                 "access plus 1 month"
	ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
	# CSS and JavaScript
	ExpiresByType text/css                      "access plus 1 year"
	ExpiresByType application/javascript        "access plus 1 year"
</IfModule>
# Gzip compression
<IfModule mod_deflate.c>
# Active compression
SetOutputFilter DEFLATE
# Force deflate for mangled headers
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
# Don’t compress images and other uncompressible content
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png|rar|zip|exe|flv|mov|wma|mp3|avi|swf|mp?g|mp4|webm|webp|pdf)$ no-gzip dont-vary
</IfModule>
</IfModule>
# Compress all output labeled with one of the following MIME-types
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE application/atom+xml \
		                          application/javascript \
		                          application/json \
		                          application/rss+xml \
		                          application/vnd.ms-fontobject \
		                          application/x-font-ttf \
		                          application/xhtml+xml \
		                          application/xml \
		                          font/opentype \
		                          image/svg+xml \
		                          image/x-icon \
		                          text/css \
		                          text/html \
		                          text/plain \
		                          text/x-component \
		                          text/xml
</IfModule>
<IfModule mod_headers.c>
Header append Vary: Accept-Encoding
</IfModule>
</IfModule>
# END WP Rocket
# BEGIN Newfold WebP Existing Image Redirect
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{REQUEST_FILENAME} -f
	RewriteCond %{REQUEST_URI} (.+)\.(gif|bmp|jpg|jpeg|png|tiff|svg|webp)$ [NC]
	RewriteCond %{DOCUMENT_ROOT}%1.webp -f
	RewriteRule ^(.+)\.(gif|bmp|jpg|jpeg|png|tiff|svg|webp)$ $1.webp [T=image/webp,E=WEBP_REDIRECT:1,L]
</IfModule>
# END Newfold WebP Existing Image Redirect
# BEGIN Newfold WebP Missing Image Redirect
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteCond %{REQUEST_URI} (.+)\.(gif|bmp|jpg|jpeg|png|tiff|svg|webp)$ [NC]
	RewriteCond %{DOCUMENT_ROOT}%1.webp -f
	RewriteRule ^(.+)\.(gif|bmp|jpg|jpeg|png|tiff|svg|webp)$ $1.webp [T=image/webp,E=WEBP_REDIRECT:1,L]
</IfModule>
# END Newfold WebP Missing Image Redirect
# BEGIN Newfold CF Optimization Header
<IfModule mod_rewrite.c>
	RewriteEngine On
# Skip setting for admin/API routes
	RewriteCond %{REQUEST_URI} !/wp-admin/       [NC]
	RewriteCond %{REQUEST_URI} !/wp-login\.php   [NC]
	RewriteCond %{REQUEST_URI} !/wp-json/        [NC]
	RewriteCond %{REQUEST_URI} !/xmlrpc\.php     [NC]
	RewriteCond %{REQUEST_URI} !/admin-ajax\.php [NC]
# Skip if the exact cookie and value are already present
	RewriteCond %{HTTP_COOKIE} !(^|;\s*)nfd-enable-cf-opt=63a6825d27cab0f204d3b602 [NC]
# Set env var if we passed all conditions
	RewriteRule .* - [E=CF_OPT:1]
</IfModule>
<IfModule mod_headers.c>
# Set cookie only if env var is present (i.e., exact cookie not found)
	Header set Set-Cookie "nfd-enable-cf-opt=63a6825d27cab0f204d3b602; path=/; Max-Age=86400; HttpOnly" env=CF_OPT
</IfModule>
# END Newfold CF Optimization Header
# BEGIN Newfold Headers
<IfModule mod_headers.c>
	Header set X-Newfold-Cache-Level "2"
</IfModule>
# END Newfold Headers
# BEGIN Newfold Browser Cache
<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresDefault "access plus 24 hours"
	ExpiresByType text/html "access plus 2 hours"
	ExpiresByType image/jpg "access plus 24 hours"
	ExpiresByType image/jpeg "access plus 24 hours"
	ExpiresByType image/gif "access plus 24 hours"
	ExpiresByType image/png "access plus 24 hours"
	ExpiresByType text/css "access plus 24 hours"
	ExpiresByType text/javascript "access plus 24 hours"
	ExpiresByType application/pdf "access plus 1 week"
	ExpiresByType image/x-icon "access plus 1 year"
</IfModule>
# END Newfold Browser Cache
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
	RewriteBase /
	RewriteRule ^index\.php$ - [L]
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule . /index.php [L]
</IfModule>
# END WordPress
#-------------------------- NEW CODE ADDED HERE ------------------------------
# Prevent hotlinking
RewriteEngine on
# BEGIN DS-XML-RPC-API
# The directives (lines) between "BEGIN DS-XML-RPC-API" and "END DS-XML-RPC-API" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https://bhutanboard.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

<Files xmlrpc.php>
order deny,allow
deny from all

</Files>

# END DS-XML-RPC-API
# --------------------------NEW ADDED CODE -----------------------------
# ----------------------------------------------------------------------
# BEGIN Browser Caching (Leverage cache)
# ----------------------------------------------------------------------
<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresByType image/jpg "access plus 1 year"
	ExpiresByType image/jpeg "access plus 1 year"
	ExpiresByType image/png "access plus 1 year"
	ExpiresByType image/gif "access plus 1 year"
	ExpiresByType image/webp "access plus 1 year"
	ExpiresByType text/css "access plus 1 month"
	ExpiresByType text/javascript "access plus 1 month"
	ExpiresByType application/javascript "access plus 1 month"
	ExpiresByType application/x-javascript "access plus 1 month"
	ExpiresByType text/html "access plus 1 hour"
</IfModule>
# ----------------------------------------------------------------------
# END Browser Caching
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# BEGIN Bad Bot Blocker
# ----------------------------------------------------------------------
<IfModule mod_setenvif.c>
	SetEnvIfNoCase User-Agent "AhrefsBot" bad_bot
	SetEnvIfNoCase User-Agent "SemrushBot" bad_bot
	SetEnvIfNoCase User-Agent "MJ12bot" bad_bot
	SetEnvIfNoCase User-Agent "BLEXBot" bad_bot
	SetEnvIfNoCase User-Agent "DotBot" bad_bot
	SetEnvIfNoCase User-Agent "Scrapy" bad_bot
	SetEnvIfNoCase User-Agent "python-requests" bad_bot
	Deny from env=bad_bot
</IfModule>
# ----------------------------------------------------------------------
# END Bad Bot Blocker
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# BEGIN Gzip Compression
# ----------------------------------------------------------------------
<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE text/plain
	AddOutputFilterByType DEFLATE text/html
	AddOutputFilterByType DEFLATE text/xml
	AddOutputFilterByType DEFLATE text/css
	AddOutputFilterByType DEFLATE text/javascript
	AddOutputFilterByType DEFLATE application/javascript
	AddOutputFilterByType DEFLATE application/x-javascript
	AddOutputFilterByType DEFLATE application/xml
	AddOutputFilterByType DEFLATE application/rss+xml
	AddOutputFilterByType DEFLATE application/font-woff2
	AddOutputFilterByType DEFLATE application/font-woff
</IfModule>
# ----------------------------------------------------------------------
# END Gzip Compression
# ----------------------------------------------------------------------
# BEGIN WP-Optimize Gzip compression
<IfModule mod_filter.c>
	<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
		AddType application/vnd.ms-fontobject .eot
		AddType font/ttf .ttf
		AddType font/otf .otf
		AddType font/x-woff .woff
		AddType image/svg+xml .svg
		
		AddOutputFilterByType DEFLATE application/javascript
		AddOutputFilterByType DEFLATE application/rss+xml
		AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
		AddOutputFilterByType DEFLATE application/x-font
		AddOutputFilterByType DEFLATE application/x-font-opentype
		AddOutputFilterByType DEFLATE application/x-font-otf
		AddOutputFilterByType DEFLATE application/x-font-truetype
		AddOutputFilterByType DEFLATE application/x-font-ttf
		AddOutputFilterByType DEFLATE application/x-font-woff
		AddOutputFilterByType DEFLATE application/x-javascript
		AddOutputFilterByType DEFLATE application/xhtml+xml
		AddOutputFilterByType DEFLATE application/xml
		AddOutputFilterByType DEFLATE font/opentype
		AddOutputFilterByType DEFLATE font/otf
		AddOutputFilterByType DEFLATE font/ttf
		AddOutputFilterByType DEFLATE font/woff
		AddOutputFilterByType DEFLATE image/svg+xml
		AddOutputFilterByType DEFLATE image/x-icon
		AddOutputFilterByType DEFLATE text/css
		AddOutputFilterByType DEFLATE text/html
		AddOutputFilterByType DEFLATE text/javascript
		AddOutputFilterByType DEFLATE text/plain
		AddOutputFilterByType DEFLATE text/xml
		
# Remove browser bugs (only needed for really old browsers)
		BrowserMatch ^Mozilla/4 gzip-only-text/html
		BrowserMatch ^Mozilla/4\.0[678] no-gzip
		BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
		<IfModule mod_headers.c>
			Header append Vary User-Agent
		</IfModule>
	</IfModule>
</IfModule>
# END WP-Optimize Gzip compression


RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://bhutanboard.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://bhutanboard.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://bhutanboard.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://bhutanboard.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.bhutanboard.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.bhutanboard.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.bhutanboard.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.bhutanboard.com$      [NC]
RewriteRule .*\.(jpg||jpeg||gif||png||bmp||webp||mp4||pdf||zip)$ – [R,NC]

# Restrict Hotlinking
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?bhutanboard.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
</IfModule>

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php8_module>
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 512M
   php_value post_max_size 256M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/nf-php74"
   php_value upload_max_filesize 256M
   php_flag zlib.output_compression On
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 512M
   php_value post_max_size 256M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/nf-php74"
   php_value upload_max_filesize 256M
   php_flag zlib.output_compression On
</IfModule>
# END cPanel-generated php ini directives, do not edit
