HEX
Server: nginx/1.28.3
System: Linux lightweb-s1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User: dawonefr-98 (1071)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //usr/share/doc/python3-cloudflare/examples/example_page_rules.sh
:

ZONE=${1-example.com}

URL_MATCH="*.${ZONE}/url1*"
URL_FORWARDED="http://${ZONE}/url2"

cli4 --post \
	targets='[ { "target": "url", "constraint": { "operator": "matches", "value": "'${URL_MATCH}'" } } ]' \
	actions='[ { "id": "forwarding_url", "value": { "status_code": 302, "url": "'${URL_FORWARDED}'" } } ]' \
	status=active \
	priority=1 \
		/zones/:${ZONE}/pagerules | jq '{"status":.status,"priority":.priority,"id":.id}'

exit 0