- Issue created by @mlncn
The last character or two is left off a link by a person copy-pasting it to a friend.
An e-mail program wraps a line at a character limit and cuts a link in half.
The link someone was trying to share is:
https://example.com/wow-this-is-an-amazing-page-you-have-to-see-it
If it gets to someone as https://example.com/wow-this-is-an-amazing
or https://example.com/wow-this-is-an-amazing-page-you-ha
and there are no other pages on the site except that one with a path alias that starts in that way, the person following that link should absolutely be redirected to the full link, to that only matching page.
Even if the link reaches someone as https://example.com/wow
if there is only one node or other page on the website with a URL alias that starts with 'wow' the visitor should be sent to that page, with the URI expanded (redirected) to the complete path.
Truncate a URL and paste it in your browser to try to visit it. You will get an unhelpful 404 even though the website should know darn well where you are trying to go.
I know WordPress has done this forever, built into their `redirect_canonical` filter. It should not be hard to do for Drupal, and i'd be very surprised if there's no module, at least for Drupal 7, but i haven't found it yet.
Drupal module to guess the right path if none match completely, but the first part does match. Drupal redirect to best match URL. Drupal redirect to full path alias if incomplete start is the same.
https://www.drupal.org/project/search404 β covers a lot of the same use case, but is much less effective if the cut off is relatively early but the beginning of the alias is still unique. Ideally our hypothetical module runs first with a super-quick match on existing aliases (and probably existing redirects too) and if nothing is found we fall back to search404.
Find this module or create it.
People get to the page they are looking for more often, not even having to know they didn't have the complete URL.
None.
None.