title: Would like to bypass CDN domain via HTACCESS. Need assistance for rewriting rules
body: <p>I have been searching the internet for some hours and tried different solutions, but i gave up. Now trying specific here.</p>
  
  <p>I am running a server for a WordPress site (Litespeed enterprise, CentOS 7)
  I am trying to achieve a rewrite rule in htaccess for bypassing the CDN for local visitors. 
  e.x all static files in WP goes trough cdn.example.com (CNAME for another record at CDN provider)
  Now i want 1 specific country to NOT retrieve files from "<a href="https://cdn.example.com" rel="nofollow noreferrer">https://cdn.example.com</a>" (static files) but instead directly via origin <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a></p>
  
  <p>I am using geoIP module for detecting users from a specific country - which works great (tested)
  But how can I rewrite inside WP the URLs to go trough <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a> instead?
  The CDN mapping is done inside WP via Litespeed cache plugin, and it has changed all the URLs to CDN.example.com which is perfect for all non-local users, but i would like to make an exception for local users in our country, since CDN has no POP and it doesnt make a sense to route traffic to another country.</p>
  
  <p>I tried this code:</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(BE)$
  RewriteCond %{HTTP_HOST} ^https://cdn.example.com$ [NC]
  RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
  </code></pre>
  
  <p>What am I doing wrong? Is that even correct and a valid approach?</p>
  
  <p>Looking forward to hear from you :) Thanks so much</p>