Dynamic Path Rewrites
This module allows you to change entity routing paths without needing to create manual path aliases. It dynamically rewrites URLs on the fly for different entity types and bundles, improving performance by caching these rewrites. This is useful for sites with many entities where creating individual path aliases would be inefficient.
Change entity type router paths without having to create path aliases. Uses inbound/outbound processing to rewrite paths on the fly. Rewrites are cached to keep subsequent requests performant. Varying paths per entity type bundle is supported. For example, /article/{node} for an article and /blog-post/{node} for a blog post. Works with any entity type route!
Usage
- Download and install the module. Recommended install method is composer:
composer require drupal/dynamic_path_aliases - Go to /admin/config/search/path/rewrite to add path rewrites.
Token replacements
Sorry, tokens are NOT supported! Tokens would add too much performance overhead. This approach is intended to avoid the creation of many path alias entities while still allowing paths to be easily changed. For example, on larger sites with many thousands of users or content. If tokens are absolutely necessary, use the tried and true https://www.drupal.org/project/pathauto module.