Transform Rule to add Query String for GEOIP

I need to cache users in different countries to serve specific VAT rates.

I have tried a few options but they led to performance issues.

What I think will work best (this is a live site so I don’t have the option to rebuild) is to use the Transform Rules to add a query string to the url based on location. That way I can then cache each country individually and serve them the correct VAT amounts from my website backend.

However, my site is based on WooCommerce so I need to exclude “wp-admin” from the query string else the backend of the website falls over.

I tried the following expression but it still keeps adding the query to the backend url (oddly it only shows in the url bar for the admin pages and not for the front end). I also need to exclude the cart pages etc but I have added “companyname-cart” to each endpoint so I if I can exclude ‘wp-admin’ I’ll just use the same method for that.

(not http.request.uri.path contains "wp-admin") or ( eq "GB" and not http.request.uri contains "companyname-cart")

I added a dynamic query string of as the rewrite.

I really need to get this to work but it’s not performing as I’d expect

What are the exact conditions - do not show querystring except if wp-admin or companyname-cart? The expression you post there seems conflicting? Please expand the role of GB in the condition then we can rewrite it.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.