mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Cloudflare documentation update (#167)
* Fix syntax errors in documentation * Add example on how to enable manage_redirects
This commit is contained in:
committed by
Tom Limoncelli
parent
d19e1fb338
commit
b5e4ab1e23
@ -110,6 +110,8 @@ The cloudflare provider can manage Page-Rule based redirects for your domains. S
|
|||||||
|
|
||||||
// chiphacker.com is an alias for electronics.stackexchange.com
|
// chiphacker.com is an alias for electronics.stackexchange.com
|
||||||
|
|
||||||
|
var CFLARE = NewDnsProvider('cloudflare.com','CLOUDFLAREAPI', {"manage_redirects": true}); // enable manage_redirects
|
||||||
|
|
||||||
D("chiphacker.com", REG_NAMECOM, DnsProvider(CFLARE),
|
D("chiphacker.com", REG_NAMECOM, DnsProvider(CFLARE),
|
||||||
// must have A records with orange cloud on. Otherwise page rule will never run.
|
// must have A records with orange cloud on. Otherwise page rule will never run.
|
||||||
A("@","1.2.3.4", CF_PROXY_ON),
|
A("@","1.2.3.4", CF_PROXY_ON),
|
||||||
@ -117,10 +119,10 @@ D("chiphacker.com", REG_NAMECOM, DnsProvider(CFLARE),
|
|||||||
A("meta", "1.2.3.4", CF_PROXY_ON),
|
A("meta", "1.2.3.4", CF_PROXY_ON),
|
||||||
|
|
||||||
// 302 for meta subdomain
|
// 302 for meta subdomain
|
||||||
CF_TEMP_REDIRECT("meta.chiphacker.com/*", "https://electronics.meta.stackexchange.com/$1),
|
CF_TEMP_REDIRECT("meta.chiphacker.com/*", "https://electronics.meta.stackexchange.com/$1"),
|
||||||
|
|
||||||
// 301 all subdomains and preserve path
|
// 301 all subdomains and preserve path
|
||||||
CF_REDIRECT("*chiphacker.com/*", "https://electronics.stackexchange.com/$2),
|
CF_REDIRECT("*chiphacker.com/*", "https://electronics.stackexchange.com/$2"),
|
||||||
);
|
);
|
||||||
{%endhighlight%}
|
{%endhighlight%}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user