Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

URL map examples

Small, realistic URL map files in CSV, JSON, Excel, LibreOffice, Apache and nginx format, with query-string redirects, temporary redirects and wildcards, each checked with exp:url:import --dry-run.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/url-maps/README.md

On this page

URL map examples

These files are small URL maps of an imagined old site, moving to the Fit & Healthy site of the Exponential demo. Copy one, change the addresses to your own and import it. Every target is a page of that site, so each file imports cleanly into it (only the node ID may need changing, see below).

How to use them: Migrating URLs. The columns and kinds: Importing and exporting URL maps. Every detail of the formats: The URL map file formats.

The files

FileFormatWhat it showsRows
old-site.csvCSVPermanent redirects of single pages, a target by node ID (node:163), an alias that shows the page at the old address8
old-site.jsonJSONThe same redirects as JSON, with the exp-url-map/1 header7
old-site.htaccessApacheRewriteRule, a Redirect of a whole section (read as Apache answers it: the page and everything below it), RedirectMatch as a wildcard, and an old address with a query (RewriteCond %{QUERY_STRING})7
old-site.nginxnginxlocation = with return, old addresses with a query (if ($args = ...)), rewrite as a wildcard, and a map of single pages7
query-and-temporary.csvCSVQuery-string redirects (/index.php?id=12), a 308, and temporary redirects by kind (redirect-temporary) and by status (307)5
wildcards.csvCSVWildcards: a section that moved, a * in the middle of an address, a temporary wildcard, and a direct one (no redirect)4
old-site.xlsxExcelThe single pages of old-site.csv as an Excel workbook: the column names in the first row of the first sheet8
old-site.odsOpenDocumentThe same as a LibreOffice spreadsheet8

"Rows" is what the import makes of the file: an Apache Redirect gives two rows (the page and a wildcard for everything below it).

Try one

Plan the file and write nothing:

./console exp:url:import doc/eng-us/examples/url-maps/old-site.csv -s site --dry-run
URL map dry run: doc/eng-us/examples/url-maps/old-site.csv (8 rows)
  Plan:   8 new, 0 changed, 0 unchanged, 0 duplicate, 0 conflict, 0 broken target, 0 unknown host, 0 not importable
  Action: 8 to create, 0 to update, 0 skipped
  Done:   8 created, 0 updated, 0 skipped, 0 failed

In a dry run, "Done" counts what the import would do. Leave out --dry-run to import, and undo it again with ./console exp:url:undo <number> (the number is printed by the import and listed by ./console exp:url:batches). In the administration, every one of these files is shown under Setup > URL translator > Import > Formats and examples, with the columns and the kinds: copy it, download it, or open a text one in the import with Open in the import (an administrator whose interface language is German sees the German files).

After a real import, check that every old address lands where the file says (the base is the site you imported into):

./console exp:url:test doc/eng-us/examples/url-maps/old-site.csv --base=https://www.example.com -s site

In the administration, Test on the page of the import's result does the same. To start a file of your own, the tutorial shows exp:url:from-sitemap, exp:url:from-404 and exp:url:suggest.

How they were checked

Each file was planned with exp:url:import --dry-run against an installation with the Fit & Healthy site: every row of every file came out as new, with no broken target, conflict, unknown host or row that cannot be imported.

On your own site

  • Replace the old addresses with your old site's and the new ones with pages of your site. A new address that does not exist is listed as broken target and not imported.
  • node:163 is the Running page of the installation the files were checked on. Node IDs differ from one installation to the next: use the node ID of your own page (the demo's Running page is node:171).
  • /user/login, /content/view/full/2 and other addresses of the system cannot be old addresses: the preview lists them as a conflict.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x