# BEGIN LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
<IfModule LiteSpeed>
  RewriteEngine on
  CacheLookup on
  RewriteRule .* - [E=Cache-Control:no-autoflush]
  RewriteRule litespeed/debug/.*\.log$ - [F,L]
  RewriteRule \.litespeed_conf\.dat - [F,L]

  # ASYNC support
  RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.php
  RewriteCond %{QUERY_STRING} action=async_litespeed
  RewriteRule .* - [E=noabort:1]

  # MOBILE detection
  RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
  RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismobile]

  # CACHE RESOURCE optimization
  RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]

  # WEBP support
  RewriteCond %{HTTP_ACCEPT} "image/webp"
  RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]

  RewriteCond %{HTTP_USER_AGENT} iPhone.*Version/(\d{2}).*Safari
  RewriteCond %1 >13
  RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]

  RewriteCond %{HTTP_USER_AGENT} Firefox/([0-9]+)
  RewriteCond %1 >=65
  RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]

  # DROPQS - strip tracking parameters
  CacheKeyModify -qs:fbclid
  CacheKeyModify -qs:gclid
  CacheKeyModify -qs:utm*
  CacheKeyModify -qs:_ga
</IfModule>
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END LSCACHE

# BEGIN NON_LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
<IfModule mod_expires.c>
  ExpiresActive on
  # Images
  ExpiresByType image/x-icon A31557600
  ExpiresByType image/vnd.microsoft.icon A31557600
  ExpiresByType image/svg+xml A31557600
  ExpiresByType image/jpg A31557600
  ExpiresByType image/jpeg A31557600
  #ExpiresByType image/png A31557600
  ExpiresByType image/gif A31557600
  ExpiresByType image/webp A31557600
  ExpiresByType image/avif A31557600

  # Media
  ExpiresByType video/ogg A31557600
  ExpiresByType audio/ogg A31557600
  ExpiresByType video/mp4 A31557600
  ExpiresByType video/webm A31557600

  # CSS and JS
  ExpiresByType text/css A31557600
  ExpiresByType text/javascript A31557600
  ExpiresByType application/javascript A31557600
  ExpiresByType application/x-javascript A31557600

  # Fonts
  ExpiresByType application/x-font-ttf A31557600
  ExpiresByType application/x-font-woff A31557600
  ExpiresByType application/font-woff A31557600
  ExpiresByType application/font-woff2 A31557600
  ExpiresByType application/vnd.ms-fontobject A31557600
  ExpiresByType font/ttf A31557600
  ExpiresByType font/otf A31557600
  ExpiresByType font/woff A31557600
  ExpiresByType font/woff2 A31557600

  # Documents
  ExpiresByType application/pdf A31557600
</IfModule>
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END NON_LSCACHE

# BEGIN Images to WebP
<IfModule mod_mime.c>
  AddType image/webp .webp
</IfModule>
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_ACCEPT} image/webp
  RewriteCond %{REQUEST_FILENAME} "/"
  RewriteCond %{REQUEST_FILENAME} "\.(jpg|jpeg|gif|png)$"
  RewriteCond %{REQUEST_FILENAME}\.webp -f
  RewriteCond %{QUERY_STRING} !no_webp
  RewriteRule ^(.+)$ $1\.webp [NC,T=image/webp,E=webp,L]
</IfModule>
# END Images to WebP

# BEGIN Hotlink Protection
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?(ppsuniversiti\.com|tyfm\.org)(\.tyfm\.org)?/? [NC]
RewriteRule \.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
# END Hotlink Protection


# BEGIN Custom API Rewrites
# Individual rewrites (optional)
RewriteRule ^loginfunction$ /api/loginfunction.php [L]
RewriteRule ^rewardshistory$ /api/rewardshistory.php [L]
RewriteRule ^productmanagement$ /api/productmanagement.php [L]
RewriteRule ^wishlist$ /api/wishlist.php [L]
RewriteRule ^bevendor /api/bevendor.php [L]

# Grouped rewrites (only use if you prefer this format instead of above)
RewriteRule ^(loginfunction)$ /api/loginfunction.php [L]
RewriteRule ^(rewardshistory)$ /api/rewardshistory.php [L]
RewriteRule ^(productmanagement)$ /api/productmanagement.php [L]
RewriteRule ^(wishlist)$ /api/wishlist.php [L]
RewriteRule ^(bevendor)$ /api/bevendor.php [L]
# END Custom API Rewrites

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
