/legacy/{site}/{path}Legacy Store URL Redirect
Resolves an old capitalautoparts.ca URL (BigCommerce-era /wheels, /tires, Shopify /collections and Odoo /shop paths) to its current Autrex page with one permanent redirect. Consumed by the Cloudflare Worker in front of capitalautoparts.ca, which forwards the original path as /legacy/capitalautoparts/{path} (or /legacy/capitalautoparts-erp/{path} for erp.capitalautoparts.ca). The Location is a product page only when a single live product matches size, brand, model and rating; otherwise a brand page, then a size or category page. It never redirects to the homepage. Brand/model collections go directly to an existing indexable wheel model; absent or thin models retain the brand page. The response carries an X-Legacy-Match header (exact, fuzzy-unique, model, brand, category, passthrough). Product paths pass through to the localized PDP, whose separate legacy identity fallback may issue a 308 to its canonical live slug. Not for browsers or crawlers to discover: these URLs are deliberately not in the sitemap.
The same-origin /api/erp relay accepts only storefront allow-listed paths and methods; other routes return 404. Browser-supplied API keys are discarded. Direct public API endpoints remain available at their documented URLs.
Use Cases
- Forward old capitalautoparts.ca product, brand and category URLs to autrex.ca in one hop
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
site | string | Required | "capitalautoparts" for capitalautoparts.ca, "capitalautoparts-erp" for erp.capitalautoparts.ca |
path | string | Required | The original URL path, slashes preserved (max 512 characters) |
Request Example
curl "https://autrex.ca/legacy/capitalautoparts/wheels/art-replica-163-17x7-0-45-5x114-3-gloss-black-machined-face"fetch("https://autrex.ca/legacy/capitalautoparts/wheels/art-replica-163-17x7-0-45-5x114-3-gloss-black-machined-face")Response
{
"status": 301,
"headers": {
"location": "https://autrex.ca/en-ca/products/art-r16317001-163-17x7-5x114-3-et35mm-gloss-black-machined-face-wheel",
"x-legacy-match": "fuzzy-unique"
}
}{
"error": "This legacy URL has no verified Autrex destination."
}{
"error": "Provide url or page_type"
}Caching
- Max Age
- 3600s