exp:expurlfrom404
Start a URL map from the not-found log: the addresses visitors asked for and did not find, the most asked first, as rows to fill in.
Script bin/php/expurlfrom404.php, code in kernel/private/classes/commands/expurlfrom404.php. Run it from the installation root, as the user the web server runs as:
./console exp:expurlfrom404 --help
./console exp:url:from-404 --help
php bin/php/expurlfrom404.php --helpHelp text
Start a URL map from the not-found log
Reads the log of pages not found (var/log/404.log and its rotated files, written while site.ini
[RequestLogSettings] NotFoundLog=enabled, the default), or with --log web server access logs, and
writes every address that answered 404 or 410 once, the most asked first, as a row with an empty
new_url and the hits in its note. Assets, bots and methods other than GET and HEAD are left out;
-s keeps the lines of one siteaccess. The log hides query values, so only the path counts there.
./console exp:url:from-404 --min-hits=3 --since=30d --output=var/tmp/not-found.csv
./console exp:url:from-404 -s site --limit=200 --output=var/tmp/not-found.xlsx
./console exp:url:from-404 --log=/var/log/nginx/access.log.1.gz --format=jsonOptions
| Option | Value | Help |
|---|---|---|
--output | required | The file to write (default the standard output; needed for xlsx and ods) |
--output-format | required | import, export: what the command prints, text (default) or json (the machine output exp-url/1); --format is the file's format there; from-sitemap, from-404, suggest: the format of the file written (csv, json, xlsx, ods, apache, nginx; default from --output, else csv) |
--format | required | import: the format of the file (csv, json, xlsx, ods, apache, nginx; default from its name or content); export: the format to write (default from --output, else csv); batches, undo, from-sitemap, from-404, suggest, test: text (default) or json (the machine output exp-url/1) |
--min-hits | required | from-404: only addresses asked for this many times or more (default 1) |
--since | required | from-404: only requests since this date (2026-11-01) or this long ago (30d, 12h, 2w) |
--limit | required | batches: how many of the last imports to list (default 20); from-sitemap, from-404, test: the most rows (default all) |
--include-assets | from-404: also images, scripts, style sheets, fonts and files below /var/, /design/ and /extension/ | |
--include-bots | from-404: also the requests of bots and crawlers | |
--log | required | from-404: read these logs instead of this installation's not-found log: 404.log files or web server access logs in the common or combined format, .gz too (a comma list or repeated) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Related
Generated by ./console exp:help:examples from bin/php/expurlfrom404.php, kernel/private/classes/commands/expurlfrom404.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.