1

For a sake of SEO, I need to be able to dynamically pass random keywords to the URL. For example, instead of the classic variable=value couples in a query (e.g. /my-node-title?selected=random-seo-keyword), I need to use a good-looking path like /my-node-title/random-seo-keyword, where my-node-title is a URL / path alias of node/xxx but random-seo-keyword does not exist in the structure and may not be predefined.

Then, on the server I handle and split the URL parts with a script. The only problem is that currently Drupal 7 returns a 404 error in such cases.

1

You can alter your paths by using hook_url_*_alter() hooks. Have a look at hook_url_inbound_alter() and hook_url_outbound_alter().

0

I found this module https://www.drupal.org/project/subpathauto thanks to Paul Jones answer in this post Passing an argument to a node causes 404

This module correctly recognizes Drupal paths in links and avoids 404 errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.