- 🇬🇧United Kingdom JamesOakley Kent, UK
It looks like this got lost when Global Redirect merged into Redirect. 💬 How to ensure "Redirect Comments To Node" Active
I've seen a few discussions in the forum section, and one or two sandbox projects, that attempt to work around this, but I wonder if the solution belongs in this module to avoid duplicating content.
Drupal 7 introduced the concept of a URL for a comment, that takes the form /comment/[comment-id]#[comment-id]. This allows you to create views that link to individual comments, where you get taken to the anchor at the start of that comment. The full node is displayed - it just gives a way to navigate to the particular comment when the page loads.
This was necessary to overcome a difficulty with Drupal 6. If comments ran to more than one page, a comment could be on page 2 of the comments. The correct URL for the comment was then /node/[nid]?page=2#[comment-id]. But instead the navigation went to /node/[nid]#[comment-id]. The result was that the comment someone was looking for wasn't on the webpage that loaded, and consequently neither was its anchor.
So Drupal 7's solution to this is to be welcomed. However: It creates another scenario where search-engine sandboxing could occur. If a node has 10 comments, each page with the URL /comment/[comment-id] loads identical content to the node itself. We thus get 11 different URLs, all with identical content.
So there needs to be a way to rewrite /comment/[comment-id]#[comment-id] as /node/[nid](?page=[pagenum])?#[comment-id]
I'm guessing that the page numbering bit is the trickiest detail of that to implement. That aside, Drupal is already inserting a
tag into the head section of those comment URLs, and the given canonical URL is the correct one. If that is already being done, this should be a solvable problem.
Fixed
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
It looks like this got lost when Global Redirect merged into Redirect. 💬 How to ensure "Redirect Comments To Node" Active