Files
stefankoelle 37f7d8f1fb Add Cloudflare redirect rules script and GitHub Action
- scripts/cloudflare/setup-redirects.sh: CLI tool to manage redirects
- scripts/cloudflare/redirect-rules.json: rule definitions
- .github/workflows/cloudflare-redirects.yml: manual trigger workflow
- Supports: apply, status, dry-run, delete
- Requires secrets: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ZONE_ID
2026-09-11 11:29:45 +02:00

73 lines
2.0 KiB
JSON

[
{
"expression": "http.host eq \"hub.moonweb.org\"",
"description": "hub.moonweb.org -> www.moonweb.org",
"action": "redirect",
"action_parameters": {
"from_value": {
"target_url": {
"expression": "concat(\"https://www.moonweb.org\", http.request.uri.path)"
},
"status_code": 301,
"preserve_query_string": true
}
}
},
{
"expression": "http.host eq \"infra.moonweb.org\"",
"description": "infra.moonweb.org -> www.moonweb.org/infra/",
"action": "redirect",
"action_parameters": {
"from_value": {
"target_url": {
"expression": "concat(\"https://www.moonweb.org/infra\", http.request.uri.path)"
},
"status_code": 301,
"preserve_query_string": true
}
}
},
{
"expression": "http.host eq \"smarthome.moonweb.org\"",
"description": "smarthome.moonweb.org -> www.moonweb.org/smarthome/",
"action": "redirect",
"action_parameters": {
"from_value": {
"target_url": {
"expression": "concat(\"https://www.moonweb.org/smarthome\", http.request.uri.path)"
},
"status_code": 301,
"preserve_query_string": true
}
}
},
{
"expression": "http.host eq \"code.moonweb.org\"",
"description": "code.moonweb.org -> www.moonweb.org/code/",
"action": "redirect",
"action_parameters": {
"from_value": {
"target_url": {
"expression": "concat(\"https://www.moonweb.org/code\", http.request.uri.path)"
},
"status_code": 301,
"preserve_query_string": true
}
}
},
{
"expression": "http.host eq \"retro.moonweb.org\"",
"description": "retro.moonweb.org -> www.moonweb.org/retro/",
"action": "redirect",
"action_parameters": {
"from_value": {
"target_url": {
"expression": "concat(\"https://www.moonweb.org/retro\", http.request.uri.path)"
},
"status_code": 301,
"preserve_query_string": true
}
}
}
]