Redirects
Send visitors from one path on your site to another address.
On this page
Before you start
- You can open the site in Managed Websites. Anyone who can open a site can change its redirects.
- These rules redirect paths, such as
/sale. To redirect a whole domain, such aswww, use Domains & HTTPS: see Add a domain.
Add a redirect
Open the site's redirects
Go to Managed Websites, choose the site, then Redirects under Site settings.
Enter the two addresses
Choose Add redirect. Enter the path to send from in From and where it goes in To, then check the For example line.
Add it and save
Choose Add redirect, then Save changes. Nothing on the site changes until you save.
The redirect is on the site within a minute or two.
Choices in the dialog
| Choice | What it does |
|---|---|
| Exact | Redirects this path only. |
| Prefix | Redirects this path and everything under it. The rest of the path is added to To. |
| Regex | Redirects paths that match a pattern. Use $1 in To for the part in brackets. |
| 301 Permanent | Browsers and search engines remember it. Use it for a page that has moved for good. |
| 302 Temporary | Checked again on every visit. Use it for offers and short-lived moves. |
| Keep query string | Passes ?utm_source=… and the like on to To. |
| Enabled | Untick to keep the rule without applying it. |
On a site with more than one domain, a rule set to Only these domains runs on those domains before the rules for Every domain. Domain rules never apply to the platform's reserved paths.
Within each of the two groups, an Exact rule always wins for its path, and so does a Prefix rule for its own path: a Prefix rule for /blog wins for /blog itself. For every other path, Prefix and Regex rules are tried from the top and the first match wins: drag a row to move it.
Test a redirect
Test a path
Choose Test a URL, enter a path such as
/blog/autumn-menuand choose Test. The result names the rule that matches and the address the visitor is sent to.
A test includes your unsaved changes: try a rule before you save it.
Import redirects
Paste the list
Choose Import and pick the Format: nginx, Apache .htaccess or CSV. Paste the list into Rules, or drop a file of up to 256 KiB.
Check it, import and save
Choose Parse: a line that cannot be imported is listed with the reason, and skipped. Choose Import 3 rules (the button counts yours), then Save changes.
A site can have up to 2,000 rules. Export downloads the saved rules in the same three formats.
Automate this
Replaces the whole table: send the version from the last read and every rule to keep, in the order they should be tried.
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/redirects \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"rules": [
{
"enabled": true,
"from": "/about-us.html",
"id": 41,
"keep_query": true,
"note": "Old brochure page",
"status": 301,
"to": "/about",
"type": "exact"
},
{
"enabled": true,
"from": "/blog",
"hosts": [
"www.harbourandfinch.example.com"
],
"keep_query": true,
"status": 301,
"to": "/news",
"type": "prefix"
}
],
"version": 12
}'Your assistant calls corestack_redirects_update.
{
"name": "corestack_redirects_update",
"arguments": {
"site_id": 4211,
"version": 3,
"rules": [
{
"type": "exact",
"from": "/old-page",
"to": "/new-page",
"status": 301,
"keep_query": true,
"enabled": true
}
]
}
}