Preliminary documentation.

Comparison with PathAuto - see: #1783906: Compare with path redirect

Which format to use

There are 3 available formats for path finder: simple, numeric and packed. The resulting short-url for example.com/node/1234 might be:

  • simple (just rewrites node as n, etc.) - example.com/n1234
  • The simple format is easiest to use (since you know that n3456 means node/3456).
  • numeric (uses digits only) - example.com/3702
  • packed (uses letters+digits) - example.com/j5R
  • The packed format offers the shortest urls. More information on how to use the packed format is below.

Dictionary

With packed format you have control over which characters are used, so you could use just lower-case letters, for example. See dictionary setting in configuration options. You should probably disallow vowels and perhaps digits which can look like vowels (0, 1) to avoid short-codes being generated which are or look like dictionary words, such as f*ck etc.

Entity types

See types setting in configuration. If you want PathFinder to deal only with node paths, remove or comment-out everything else from the types configuration - this will make the coded paths shorter.

Description of configuration values

The following configuration variables are defined in pathfinder_config.inc.

    // Prefix/suffix strings for url building.
    'fixes' => array('', '/'),
    // Formats are currently: simple, numeric, packed.
    'format' => 'packed',
    // Dictionary for 'packed' format. We omit all vowels to avoid generation of dictionary words.
    'dict_str' => 'bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ0123456789',
    // Whether to redirect a request to current url if different - used by PathFinder Redirect.
    'redirect' => TRUE,
    // Entity types and internal types that we handle.
    // Note, 'simple' format uses the keys given here to build an alias (e.g. n123, u1, t9 etc.)
    'types' => array(
      'n' => 'node',
      'c' => 'comment',
      't' => 'taxonomy_term',
      'u' => 'user',
       // Allow for further expansion (aliases, etc.)
      'x' => 'xpanded',
    ),

    // Whether to use Pathauto (if installed) to generate aliases.
    'alias_use_pathauto' => TRUE,
    // Whether to use standard Drupal aliases.
    'alias_use_standard' => TRUE,
    // Whether to override the standard alias. If FALSE we won't process any path which already has a defined alias.
    'alias_override' => TRUE,
    // Whether to override the front-page path with an empty path.
    'frontpage_override' => TRUE,
    // Whether to convert incoming comment/123 to comment/123#comment-123 (not yet implemented).
    'comment_fragment' => TRUE,
    // Turn off if url_inbound_alter hook is not to be run (e.g. to support some other module.)
    // If configured to use paths like node/1234-anything-here then inbound processing can be switched off.
    'process_inbound' => TRUE,
    // Turn off if url_outbound_alter hook is not to be run (e.g. to support some other module.)
    'process_outbound' => TRUE,
    // Config version (not version of the module!) see @todo below.
    'version' => 0,
    // Possibly have a version-specific url-prefix, but not vital as we can change 'fixes' above.
    //'version-prefix' => '';