How To Make Open Graph Links Work With 301 Redirects

I am using friendly URLs on a VB.NET application and I was sharing the URLs on social media and the image preview was working fine. The link can be shared as follows:


To avoid sharing two versions of the URL for the same article, I created a 301 redirect on Pre_load to redirect the first link to the second corresponding link. This way, I make sure every visited URL contains the article title at the end.

Right after I applied this logic, the URLs without the article title at the end (first URL) do not show image preview on social media anymore. Twitter card validator and Facebook open graph debugger says that there was a 301 redirect and that no meta tags were found.

Below is the code that runs on page Pre_Load:

'Comparing URL title with the actual Article title

If strURLTitle <> strArticleTitle Then 
'URL article title either changed or does not exist

    Response.Status = "301 Moved Permanently"
    Response.AddHeader("Location", "{ID-in-the-URL}/article-title")

End If

Here is a sample HTML I used:

<meta name='author' content='test' />
<meta name='keywords' content='test,test,test' />
<meta name='description' content='test test test' />
<meta itemprop='name' content='test' />
<meta itemprop='description' content='test' />
<meta itemprop='image' content='' />
<meta property='og:title' content='test' />
<meta property='og:description' content='test test test' />
<meta property='og:image' content=''' />
<meta property='og:image:secure_url' content=''' />
<meta property='og:image:width' content='780' />
<meta property='og:image:height' content='439' />
<meta property='og:site_name' content='test' />
<meta property='og:url' content='' />
<meta property='og:type' content='article' />
<meta property='og:locale' content='ar_AR' />
<meta name='twitter:card' content='summary' />
<meta name='twitter:site' content='' />
<meta name='twitter:title' content='test' />
<meta name='twitter:description' content='test test test' />
<meta name='twitter:image' content='' />
<base href='' />


Testing the link (without the article title) on Twitter Card Validator yields the following Log:

INFO: Page fetched successfully
WARN: No metatags found
WARN: this card is redirected to

Testing the link (without the article title) on Facebook Debugger yields the following log:

Response Code 400

Fetched URL

Canonical URL

Redirect Path
Input URL 301 HTTP

Is there any way to let the open graph debuggers escape the 301 redirects or display the correct results even if I shared a link without a title at the end?



Since I was using Arabic characters in the URL, it turned out that I need to Encode the URL to make it work on Facebook and Twitter.


Response.Status = "301 Moved Permanently"
Response.AddHeader("Location", "{ID-in-the-URL}/" & HttpUtility.UrlEncode(article-title))

<meta property='og:url' content='' />

Another Fix:

Use a canonical URLs:

<link rel="canonical" href="" />