0

I have found something strange in the URL on my drupal. I can add text after the node id and the page display as normal. Example :

https://www.drupal.org/node/11111

return the same as

https://www.drupal.org/node/11111/thisisatest

How can I avoid this, as this is starting to getting referenced by Google (at least for one url)

  • This is not Drupal's default behavior, there is no .../thisisatest route for nodes in Drupal core, it should trigger a HTTP 404 not found error. – Hudri Jan 14 at 14:49
  • LOL drupal.org/node/11111/thisisatest indeed is a valid site on D.O. – leymannx Jan 14 at 15:01
  • @Hudri is right this isn't standard for D8 I've just tried it. In D7 it works because of the way hook_menu works with wildcards. So you must have something on your D8 site causing this (if you are indeed using 8 as tagged in your question) – Leigh Jan 14 at 15:05
  • Anyway, no matter if it exists or not: Any 3rd party can theoretically create unlimited indexable, valid links on foreign domains by simply using < a href="mydomain.com/nice_url?ugly_parameter">Bombing google index< /a >. The reliable way to counter this is to set a rel="canonical" in your HTML head. Metatag module might be helpful here. – Hudri Jan 14 at 15:48
  • I mislabeled the question. It is a Drupal 7 sorry. @Hudri It would be the best solution to use a canonical indeed, I don't know if it is a Drupal or Metatag problem, but the canonical meta contain the text too (/thisisatest) – Leeroy521 Jan 15 at 7:55

Your Answer

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

Browse other questions tagged or ask your own question.