mirror of
https://github.com/skoelle/moonweb-site.git
synced 2026-09-18 01:10:25 +00:00
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
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
[
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user