When migrating a legacy site (e.g. www.kentramblers.org.uk) to NGX Ramblers, external organisations and search engines hold links to specific URLs on the old site. This feature ensures those links continue to work by automatically discovering, mapping, and redirecting legacy URLs to their new equivalents.
Navigate to Admin > Legacy Redirects and select the Scrape tab.
www.kentramblers.org.uk)#WW) are recorded as separate mappable URLsThe scraper can be re-run at any time to discover new or changed pages. Existing URLs are preserved and only new ones are added.
After scraping, click Auto-Map to run the mapping algorithm. It matches legacy URLs to new NGX pages using multiple strategies:
/walks/*, /gallery/*, /contact*Each mapping receives a confidence score (high, medium, low, or unmapped).
The Mappings tab shows all discovered URLs with their proposed targets:
The Summary tab shows a dashboard with:
Once mappings are accepted, the system serves 301 permanent redirects for matching incoming requests. This happens automatically via Express middleware — no additional configuration is needed.
/api/*) are never redirectedEach NGX site can have its own set of legacy URL mappings. To configure which legacy
domains should trigger redirect lookups, add a legacy-redirect config key in the
system settings with:
{
"legacyDomains": ["www.kentramblers.org.uk", "kentramblers.org.uk"],
"cacheRefreshMinutes": 5,
"hitFlushIntervalSeconds": 60
}
Multiple legacy domains are supported per site.
Shared Model:
projects/ngx-ramblers/src/app/models/legacy-url-redirect.model.ts — interfaces and enumsServer — Database:
server/lib/mongo/models/legacy-url-mapping.ts — Mongoose schema (collection: legacyUrlMappings)server/lib/mongo/models/legacy-scrape-run.ts — Mongoose schema (collection: legacyScrapeRuns)Server — Routes:
server/lib/mongo/routes/legacy-url-mapping.ts — CRUD + /bulk-update-status, /auto-map, /summary, /target-urlsserver/lib/mongo/routes/legacy-scrape-run.ts — CRUD routesServer — Core Logic:
server/lib/legacy-redirect/redirect-middleware.ts — Express middleware with in-memory cache and batched hit countingserver/lib/legacy-redirect/auto-mapper.ts — multi-strategy mapping algorithmserver/lib/legacy-redirect/legacy-url-scraper.ts — starts at the home page and follows links outward to find every internal page, fetching each one via the integration workerserver/lib/legacy-redirect/legacy-redirect-ws-handler.ts — WebSocket handler for long-running scrape operationsFrontend — Services:
projects/ngx-ramblers/src/app/services/legacy-redirect/legacy-url-mapping.service.tsprojects/ngx-ramblers/src/app/services/legacy-redirect/legacy-scrape-run.service.tsFrontend — Admin Component:
projects/ngx-ramblers/src/app/pages/admin/legacy-redirects/legacy-redirects.component.ts
projects/ngx-ramblers/src/app/pages/admin/legacy-redirects/legacy-redirects.component.sass
projects/ngx-ramblers/src/app/models/config.model.ts — added LEGACY_REDIRECT ConfigKey
projects/ngx-ramblers/src/app/models/websocket.model.ts — added LEGACY_URL_SCRAPE EventType
projects/ngx-ramblers/src/app/modules/admin/admin-routing.module.ts — added legacy-redirects route
server/lib/mongo/controllers/extended-group-event.ts — exported convertTitleToSlug for reuse
server/lib/server.ts — registered routes and redirect middleware
server/lib/websockets/websocket-server.ts — registered WebSocket handler
legacyUrlMappings — compound unique index on (legacyDomain, legacyPath, legacyFragment)
legacyScrapeRuns — scrape operation history with audit logs
GET/POST/PUT/DELETE /api/database/legacy-url-mapping — standard CRUD
POST /api/database/legacy-url-mapping/bulk-update-status — bulk status changes
POST /api/database/legacy-url-mapping/auto-map — trigger auto-mapping
GET /api/database/legacy-url-mapping/summary — aggregate counts
GET /api/database/legacy-url-mapping/target-urls — autocomplete data
GET/POST/PUT/DELETE /api/database/legacy-scrape-run — scrape history CRUD
WebSocket: LEGACY_URL_SCRAPE event type for long-running scrape+map operations