October 7, 2026 · Rules & Routing · About 8 minutes

Shadowrocket Rules: Route Only Selected Websites with DOMAIN-SUFFIX and FINAL,DIRECT

Use DOMAIN-SUFFIX or DOMAIN-KEYWORD to send selected sites through PROXY, while FINAL,DIRECT sends all unmatched traffic directly. Includes rule order and verification steps.

At a glance

If you already have a working proxy server and want only a few websites to use it, list their domains as PROXY in your Shadowrocket configuration, then use FINAL,DIRECT for connections that don’t match. This guide uses the iPhone and iPad interface to show how to enable the configuration and verify the rules with requests to both listed and unlisted sites.

Minimal rules to proxy selected websites

Add matching conditions and policies to the [Rule] section of your configuration file. Use DOMAIN-SUFFIX when you know the full domain suffix; use DOMAIN to match one exact hostname. PROXY on the right sends traffic through the proxy, while DIRECT connects without using the selected proxy server. The snippet below is not a complete configuration file; the domains are examples to illustrate what each rule matches.

[Rule]
DOMAIN-SUFFIX,example.com,PROXY
FINAL,DIRECT

With these rules, example.com and docs.example.com match the first line. notexample.com does not share that suffix, and example.net does not match either; both fall through to FINAL,DIRECT. Enter a hostname, not a full URL: the hostname in https://docs.example.com:443/guide is docs.example.com. Don’t include the scheme, port, or path in a domain rule.

2 lines
Rules in the minimal example, excluding the section header
3 fields
DOMAIN-SUFFIX: type, suffix, policy
2 fields
FINAL: type, fallback policy

Bottom line: review the existing proxy rules first

If the original configuration contains other rules or rule sets that send connections to PROXY, changing FINAL alone won’t route them directly. To test a short list of domains, use a separate test configuration to narrow the scope instead of simply appending two lines to the original file.

Rule order and DOMAIN-KEYWORD matching

Rules are checked in order, and the first match determines the policy. Put exceptions before broader rules. For example, to proxy example.com and its subdomains while keeping status.example.com direct, place a DOMAIN rule for that hostname before the suffix rule. If you reverse the order, the status page matches the suffix rule first.

[Rule]
DOMAIN,status.example.com,DIRECT
DOMAIN-SUFFIX,example.com,PROXY
DOMAIN-KEYWORD,demo-assets,PROXY
FINAL,DIRECT

When proxying only a few sites, list known hostnames individually. Don’t use overly short keywords just to save lines. IP-CIDR and GEOIP in the original configuration handle IP ranges or IP geolocation, not a list of website domains. Before keeping these rules, make sure their policies match your intent.

Save the rules in Config and enable routing

These steps assume you already have a configuration and a proxy server. You’ll edit Shadowrocket’s routing configuration, not the server address or subscription address in Home. Keep the original configuration so you can restore it if the test fails.

  1. Keep the original configuration

    Open Config from the bottom bar, note the currently selected configuration file, and keep an unchanged copy. If the configuration is updated remotely, test with a local copy to avoid losing your changes when it refreshes.

  2. Edit the rules section

    In Config, open the test file for editing and adjust the rules in its existing [Rule] section. Replace the example suffix with the actual hostname, and keep a FINAL,DIRECT rule at the end. If the file has other sections, don’t replace the entire file with this snippet.

  3. Select the test file

    After saving, return to Config and make sure the edited file is selected. If you edited only a copy but the original file is still selected, Home won’t use the new rules, even when connected.

  4. Change the routing mode

    Go to Home → Global Routing and select Config, then return to Home, select an available server you already have, and connect. Here, Config is a routing mode; Config in the bottom bar is where you manage configuration files.

  5. Start a new connection

    Close the test page and visit it again. If the browser reuses an existing connection, quit and reopen it. Test one hostname on your list and one that isn’t, noting the hostname for each request.

Don’t test these rules with Proxy or Direct under Global Routing: neither mode uses your list to decide where traffic goes. Scene lets you choose a routing mode based on a scenario; to keep testing variables to a minimum, select Config while checking these rules.

Verify proxy matches and direct fallback

Don’t rely only on whether a webpage loads. The same page may load over either route, and a working homepage doesn’t mean its images, login, or API requests use the same route. Replace the example domains with hosts you can actually access. In Data, find the requests by time and hostname, then check the policy or matched rule.

Test caseExpected policyCheck first if results differ
A subdomain on the list, such as docs.example.comPROXYWhether the logged hostname actually ends with the configured domain
An explicitly excluded hostname, such as status.example.comDIRECTWhether the exact-match exception appears before the suffix rule
A hostname that matches no earlier rule, such as example.netFINAL,DIRECTWhether the test configuration is selected and a broad rule is matching first

If a request to a target site matches PROXY but still fails, return to Home and use Connectivity Test to check the selected server. This can help determine whether the server is reachable, but it doesn’t prove that a website matched a rule. If the log shows only an IP address, first confirm the test accessed the site by domain name rather than by entering an IP directly in the address bar. Add a separate IP-CIDR rule only if you know the relevant address range and need IP-based routing.

Connection timeouts and unexpected routing

Error: ERR_CONNECTION_TIMED_OUT

Cause and fix: This browser error means the connection wasn’t established within the time limit. By itself, it doesn’t tell you whether the proxy or direct route is at fault. Check which policy the timed-out hostname actually matched. If it matched PROXY, run Connectivity Test; if it matched DIRECT, compare the result for that hostname on the same network without the proxy.

Why are other sites still going through the proxy after I changed FINAL?

First, go to Home → Global Routing and make sure Config is selected, then check the active file in Config. If both are correct, check whether requests routed unexpectedly through the proxy matched an earlier rule, rule set, or overly broad DOMAIN-KEYWORD. Edit the rule that matched first instead of adding another fallback.

Why does the page load but sign-in keeps spinning?

Sign-in may redirect to another hostname, or the page may load resources from a separate domain. Try signing in again, then check related requests by time to identify the specific hostname that failed. If it needs the proxy, add that hostname with DOMAIN first, then retry sign-in. You don’t need to add the entire parent domain.

Can I route only one page path through the proxy by using its URL?

The domain rules in this guide can’t distinguish between two paths on the same host. For example, docs.example.com/guide and docs.example.com/help have the same hostname. To target one distinct subdomain, replace DOMAIN-SUFFIX with DOMAIN for that host; don’t append a path to the match value.

How do I restore the original rules after testing?

Return to Config and reselect the file you noted before making changes, then restore your original Global Routing option in Home. Start a new test connection and confirm the original route is back. Keep the test copy so you can use it again to isolate issues rule by rule.

Download Shadowrocket