I'm adding Facebook Open Graph meta tag to my site. For example:
<meta property="og:image" content="../images/aa.jpg"/>
Does Open Graph take relative URLs?
Otherwise, how can I convert a relative url to an absolute url in asp.net mvc3 - Is there any available function to do so?
The Correct Answer They define the og:image value as the following... A string of Unicode characters forming a valid URL having the HTTP or HTTPS scheme. So that means that even though Relative URLs will work. Facebook uses a fallback approach for Invalid Full URLs.
Open Graph meta tags are snippets of code that control how URLs are displayed when shared on social media. They're part of Facebook's Open Graph protocol and are also used by other social media sites, including LinkedIn and Twitter (if Twitter Cards are absent). You can find them in the <head> section of a webpage.
Open Graph is an internet protocol that was originally created by Facebook to standardize the use of metadata within a webpage to represent the content of a page. Within it, you can provide details as simple as the title of a page or as specific as the duration of a video.
A relative URL is a URL that only includes the path. The path is everything that comes after the domain, including the directory and slug. Because relative URLs don't include the entire URL structure, it is assumed that when linking a relative URL, it uses the same protocol, subdomain and domain as the page it's on.
Documentation have nothing about it, but relative URLs will not work, only full URL including scheme works.
As long as only full URLs supported you may convert relative to absolute url using URL.Content
method (as suggested in What is the equivalent to Page.ResolveUrl in ASP.NET MVC?)
NOTES:
http://ogp.me/ns
RDF schema (in Turtle) og:image
specified as ogc:url
which have next description:A string of Unicode characters forming a valid URL having the http or https scheme.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With