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
| File | Format | What it shows | Rows |
|---|---|---|---|
old-site.csv | CSV | Permanent redirects of single pages, a target by node ID (node:163), an alias that shows the page at the old address | 8 |
old-site.json | JSON | The same redirects as JSON, with the exp-url-map/1 header | 7 |
old-site.htaccess | Apache | RewriteRule, 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.nginx | nginx | location = with return, old addresses with a query (if ($args = ...)), rewrite as a wildcard, and a map of single pages | 7 |
query-and-temporary.csv | CSV | Query-string redirects (/index.php?id=12), a 308, and temporary redirects by kind (redirect-temporary) and by status (307) | 5 |
wildcards.csv | CSV | Wildcards: a section that moved, a * in the middle of an address, a temporary wildcard, and a direct one (no redirect) | 4 |
old-site.xlsx | Excel | The single pages of old-site.csv as an Excel workbook: the column names in the first row of the first sheet | 8 |
old-site.ods | OpenDocument | The same as a LibreOffice spreadsheet | 8 |
"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-runURL 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 failedIn 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 siteIn 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:163is 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 isnode:171)./user/login,/content/view/full/2and other addresses of the system cannot be old addresses: the preview lists them as a conflict.