Facebook not getting meta tag and not able to scrape URL
Asked Answered
M

1

1

I am using addthis for sharing in social networking site. I am trying to share title, description etc. on FB. It is working but not getting my title and description.

I am using an Open Graph Debugger tool, it says that

Object at URL 'XXXXX' of type 'website' is invalid because a required property 'og:title' of type 'string' was not provided.

when i click on Scraped URL See exactly what our scraper sees for your URL it display none. so what is the problem?

code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:og="http://ogp.me/ns#"
  xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta property="og:title" content="APPOITMENT" />
<meta property="og:type" content="article" />
 <meta property="og:url" content="http://xxxxxxxx/client/appointment/index" />
 <meta property="og:site_name" content="CBD"/>
  <meta property="og:description" content="Workday, a provider of cloud-" />

I have done some debugging. I use codeigniter framework and i use .htaccess file for redirecting purpose. when i use same code in core php file, then it is working. but in codeigniter it is not working.

.htaccss:

 RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule .* index.php/$0 [PT,L]

EDIT:

It seems that CI use URL like controller/function/. so i think this is the reason FB not able to scrape page. so do i need to create single php file that contains meta tag?

Mcspadden answered 27/8, 2014 at 12:53 Comment(3)
When you clicked on "See exactly what our scraper sees for your URL" you see no content - but if you look at the source of that page you'll see that there is content there (just no visual content) - but the og:tags are indeed missing.Passepartout
@Lix: Yes, but that page contain visual data as well as meta tags. If i run same code in single php file then it is working but in CI it is not working. may be because of .htaccss file.Mcspadden
I have no experience with codeigniter so I can't really help you there.Passepartout
W
1

Try to debug your root URL. https://developers.facebook.com/tools/debug/

This will also force Facebook to update your meta details.

Whoosh answered 27/8, 2014 at 12:55 Comment(1)
I use that, it says: The 'og:type' property is required, but not present. The strange thing is it is working in core php file but not in framework.Mcspadden

© 2022 - 2024 — McMap. All rights reserved.