Writing custom routing rules
Rules decide which traffic uses which proxy group. Once you know a handful of rule types, you can steer any site precisely.
Common rule types
DOMAIN-SUFFIX,example.com,PROXY — matches a domain and all subdomains; the workhorse.
DOMAIN,www.example.com,DIRECT — matches one exact domain.
DOMAIN-KEYWORD,tracker,REJECT — matches any domain containing the keyword.
IP-CIDR,192.168.0.0/16,DIRECT,no-resolve — matches by IP range.
GEOSITE,category-ads-all,REJECT — matches a domain set from the GEO database.
MATCH,PROXY — the catch-all; always last.
Adding rules the right way
- Never edit the subscription file directly (updates overwrite it) — put rules in the global extension config.
- On the Profiles page, right-click the “Merge” card and choose “Open File”.
- Add rules under prepend-rules (prepend means inserted first, matched with priority).
- Save, reactivate the profile, and confirm the rules appear on the Rules page.