Open graph can resolve relative url?

ebattulga picture ebattulga · Mar 25, 2012 · Viewed 33.1k times · Source

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?

Answer

Juicy Scripter picture Juicy Scripter · Mar 25, 2012

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:

A string of Unicode characters forming a valid URL having the http or https scheme.