Following WorldFallz’ advise, I rewrote the comments (field) hyperlink. For that I ticked checkbox "Use absolute path".

Instead of showing me
http://www.mydomain.com/mypath/mypath2#comment-123
Views prints two slashes after the domain
http://www.mydomain.com//mypath/mypath2#comment-123

Where [path] is "mypath/mypath2" and [cid] is 123.

This is a picture of my settings.
And this is a picture of my view.

Comments

dawehner’s picture

Status: Active » Closed (works as designed)

[path] provides you a url('node/$nid') here which adds an '/' to the url. There is a comment link handler which links to comments for you.

Danic’s picture

Thanks for the explanation.

The comment link handler is useless in my case as
http://www.mydomain.com/comment/123#comment-123
is exactly the same site as
http://www.mydomain.com/mypath/mypath2#comment-123

That is already unnecessary, but having two URLs for the same page is also bad for SEO. Any ideas on how to fix this?

dawehner’s picture

Oh seo you misterious system. Investing in actual good content is way better from my perspective ...
Anyway

Use the following code in the field handler: node/[nid]#comment-123 and you will see that this will generate the right alias,
because views automatically generates the right aliases for you.
But this actually doesn't work all the time. You have no idea to link to the right page with this kind of behavior. Therefore comment/123 got introduced which automatically give you the right page.

If you care about seo i can give you a very high amount of duplicate content:

* node/123/foo
* node/123/bar
* node/123/foobar
* node/123/foobarfoo
* node/123/foobarfoobar

you will see all work on your drupal installation.

Danic’s picture

dereine, that worked. Thank you a lot!
I am not sure whether I should change the category and close it. Other people may run into the same problem wondering why [path] in the URL creates two slashes, because they don't know that Views creates the right paths for me.

Off-Topic:
Sure, content is important and I have a lot of it. But if I can improve my sites seo a little, then I do it. Besides, if I have duplicate URLs like /mypath/mynode and /comment/137 this is not only wrong (because the comment is not the main item/topic on the page), I also have a nice list of viewed pages on my Analytics software, because /comment/137 does not show up to confuse me.

All of your examples work, of course. But the difference is, that I have no links on there pages. So I have no reason to care about that behaviour. And Google won't be able to index them, anyway.

Danic’s picture

Issue summary: View changes

Fixed Links.