문제

The link to certain pages on a site I've written looks like this:

http://myhymnal.net/2/be-thou-my-vision

That would be the id and a slug. When I paste this URL into the Facebook post field, the URL it ends up fetching an "example" of is the following:

http://myhymnal.net/2/2/be-thou-my-vision

Could anyone help me figure out where that extra 2/ comes from? I don't understand it.


Findings

  • The URL I paste in is http://myhymnal.net/2/be-thou-my-vision and works fine in the browser.
  • The base href is set to http://myhymnal.net/ and I have set the canonical to 2/be-thou-my-vision, which is relative to the base URL and should work fine. Although I suppose this maybe could be what's messing it up?

Other than that I really have no clue... :(

도움이 되었습니까?

해결책

Look at Facebook's Debug Tool - you're setting the canonical URL relative to the current directory, not the site root - facebook is then fetching http://myhymnal.net/2/2/be-thou-my-vision

Use a fully qualified URL for the canonical URL

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top