Facebook like box not allowed additional query string from wordpress site? - php

I am unable to share wordpress page with my custom query string in facebook like box using facebook api. for example http://www.example.com/?page_id=10&myquery=10 after hit like button "myquery=10" is removed from above url, only we are getting "http://www.example.com/?page_id=10" in my wall.
Thanks&Regards,
Arunabathan.G

The problem here is the canonical URL you've set your page to.
How to discover the problem?
If you check out your URL on the facebook url debugger tool, you'll see that the fetched URL if the url with the querystring (http://breakbounce.com/lookbook/?slideID=4), but the canonical URL does not have the querystring (http://breakbounce.com/lookbook/).
Where does this comes from?
This problem can be originated by two meta-tags, either og:url is defined to a different URL or a <link rel="canonical" ...> is defined (being the last one your problem, view your page souce and search your code for <link rel='canonical' href='http://breakbounce.com/lookbook/' />)
How to fix it?
In a normal situation you need to alter or delete the tag you identified as problematic on the previous step.
In you case you need either to change or delete the <link rel='canonical' href='http://breakbounce.com/lookbook/' /> tag.
Importante Note: After changing or deleting the tag you'll need to visit the facebook URL debugger again and enter your URL, in order to clear the cache of your url from Facebook.
Anything let me know.

You can also fix it like this:
http://www.example.com/?page_id=10%26myquery=10
the %26 is an equivalent for the ampersand. I had this problem when I tried additional parameters in a query, and this worked for me :)

Related

Facebook sharer should pull images from fetched URL not from canonical URL?

Recently i have noticed that if someone shares my website URL in facebook sharer then it pulls images from canonical URL not from fetched URL that is happening because of i have added -
<meta property="og:url" content="http://www.mywebsite.com"/>
<meta property="og:description" content="description related to page/images">
but it is showing every time my home page's images not of fetched URL
my URL are looking like that-
canonical URL - http://www.mywebsite.com
fetched URL - http://www.mywebsite.com/tags/car
So i'm not getting any idea what do i do so facebook sharer always show my fetched URL's images.
I know this could be same question asked before like these-
Is it possible to extract metadata from fetched url instead of canonical url?
Canonical url being linked on Facebook rather than real URL. Dynamic OpenGraph tags coming up empty
but there is a same solution in both question that is -
I need to setup Intermediate URL redirection, so i just searched about the 301, and 302 redirection, but i'm not getting any idea how/where do i use it?
I need to do this for my wordpress and an other website(which is in zend framework).
Please tell me anything if anyone has did the same.
I will be grateful for Any help.
The problem you are facing is, that you are sending your home url as a canonical url of the shared url. This is wrong as a canonical url has to point to a resource with the same content as the fetched url. For a definition of what canonical urls are check RFC6596 or a good description from Google.
Pointing to the Index URL of you site, as you do, is not pointing to a canonical (equivalent) URL. By setting that URL you are saying to Facebook "You can go look there, you will find the same content as here. So just take everything from there." But I guess this is not what you intend.
If you still want to point to you index (which imho is abusing the system), then you can try also adding the metadata for an image, which should result in the image you provide to be used to represent the link:
<meta property="og:image" content="http://www.mywebsite.com/path/to/image.jpg" />
The reason, why you shouldn't point to your index as canonical: If a user A wants to share some specific content, user B clicking on the link in facebook won't find the expected content, instead he'll see the index page and doesn't know which content user A wanted to share.
The correct way to use the og:url meta, is to point to a real canonical (equivalent) URL which will show the smae content as the fetched URL. Often such a link is referred to as permalink. If you can't provide such an url just use the fetched url itself or leave it away. Pointing to the index is wrong.
For wordpress there is a plugin, which should do this correctly. And the open graph protocol is documented here.
Facebook uses og:url tag to consolidate the like and share count. Whatever url you will mention in og:url, facebook will share that url and increase the share count for that url. Otherwise, your likes and shares will be distributed among canonical urls.
<meta property="og:url" content="http://www.mywebsite.com"/>
If you set a og:image tag, then facebook sharer will pick that image. But make sure the image is of correct dimensions. Facebook check the dimension as well. I always use 600X315.
Check image sizes here.
<meta property="og:image" content="http://www.mywebsite.com/path/to/image.jpg" />
Once you are done don't forget to clear the cache.
Put your URL here
Fetch new scrape information to see the changes.
Meta tags like keyword, title and descriptions are used by search engines.
og tags are used by facebook.
and canonical urls are by rel="canonical"
For any url, whatever data you want Facebook to fetch, needs to be set in og tags.
And then debug the URL to see the new scrape information to see the changes.

Crawler adds parameter from url to links

I tried two different web crawler (Sistrix and http://ssitemap.com). Both crawlers report errors about duplicated content for URLs like / and /?katID=12.
It turns out that if the crawler calls the url /projekte/index.php?katID=12 it finds Home and adds it as link to /?katID=12. Looks like the parameter from the url ?katID=12 is added to every link on the page that does not have a parameter.
If I use a browser or wget I see my simple html link to / as wanted.
Did I do something wrong? Server config?
Is this a bug or a feature in the crawler?
I added <link rel="canonical" href="..."> to every page to help crawlers identify equal pages.
See also http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394

Controller action called twice

I am developing an web app with Laravel and I encountered this "strange" behavior. Some controller actions are called twice. I know so because on my logs I see (for one page refresh) two full sets of entries. My controller action starts like this:
public function action_edit($rid=-1) {
// Calc Input
$id = Input::get('id', $rid);
Log::TWICE("?? {$id} - {$rid}");
where $rid is the object id to edit as requested by the url, however if I get an id in my Input, then I use this id instead. So when I call my controller via a url like:
.../mycontroller/edit/1
I get TWO entries in my log file:
2013-02-07 00:49:15 TWICE - ?? 1 - 1
2013-02-07 00:49:16 TWICE - ?? img - img
The first one is the normal that I should see, however the second one I don't understand where it is coming from. I checked using the Chrome's developer tools (both network tab and console tab) but there is no sign of the second request!! I initially thought that I might try to use some resource with a relative url of img or ../img but I found no clue. Of course img is the name of my images folder on my template but there is nowhere in my code a relative url img by itself...
Do you have any suggestions regarding this issue? Where else in my code should I examine/check? What else could trigger the second call?
NOTE: I am using the following call at some point on my code but the referenced action is 'show' not 'edit'!!
Laravel\Routing\Controller::call($controller.'#show', ...
Thank you in advance!
Pan
This is probably the browser trying to request a Favicon.
Try with curl and you most likely won't see the request.
I had a similar problem, and the cause was a Trend Micro Firewall we were behind.
The datacenter was crawling every URL submitted, causing it to be hit twice.
This post has more information
http://community.trendmicro.com/t5/Worry-Free-Business-Security/WFBS-Trend-Micro-sending-our-data-from-an-IP-in-Tokyo/td-p/15600
I spoke to our web admin who said he would exclude the site from TrendMicros link site check
This is an old question, but I still see this at the top of the Google result when I search for solution, so I decided to add this answer after I finally find the problem.
The current answer that marked as correct is only partially correct: it is related to image, but it is not limited to Favicon.
Somehow all major browser (at least for IE, Firefox and Chrome) decide that when there is an empty link provided to whatever place that is supposed to be an image, they will make it the current URL. Some example of places that may cause problem:
<img src="">
<div class="background-image:url()"></div>
<link rel="icon" type="image/x-icon" href="">
Provide a link or simply remove the line will solve the problem.

Link is not working well in Facebook App

I am facing a small problem in my Facebook application. when I left single click any link, it will not work, but it will work perfectly when I tried to use right click and open in new window option. Please help me to find out the problem.
This is the URL, please check it http://apps.facebook.com/moviereviewforyou/
The code is:
<a href="{$url->reviewMovie($file.fkey)}">
<img src="{$url->img2($file.thumbnail)}" alt="{$file.ftitle}" width=100 height=100/>
</a>
Looks like you don’t have a (valid) SSL certificate – at least that’s the first thing my browser warns me about when I try to access your app (Facebook automatically redirects me to the HTTPS version of it’s page, because I have that option set in my account’s security settings).
And then you have your links href attributes set with a hard-coded "http://…" at the beginning, which is also not good when the user uses your app over HTTPS. Just use relative links instead of absolute URLs; or at least have them begin like "//example.com/…" (this lets the browser decide which protocol he has to use, based on the protocol used to request the page these links are embedded in).
The page you are referring to has the following in the <head> tag:
<noscript><meta http-equiv="X-Frame-Options" content="deny" /></noscript>
This is what denies showing the page in a frame. Remove this line, or set content to allow to let it show in the frame.
EDIT:
I noticed that the row I mentioned is in the header of FaceBook itself, not in yours. Are you referring to your page correctly? You shouldn't refer to the facebook page containing your page, but to your page directly.

How to force facebook share button to share the url in a different format?

I use the following share button to my page. Unfortunately my urls that are shared through my page have Greek letters in it "as" below:
http://www.domain.com/gb/news/12/13311/the-name-of-article-written-in-greek.htm
and I guess this causes a problem where the facebook does not show any image or content of the page. It only shows the url.
I found out that if I manually cut the above url to
http://www.domain.com/gb/news/12/13311/
the share works properly and the current page is shown. Everything is great.
So my question is how should I force the facebook share button to share the page after the modification? I know that by using var_dump($url['dirname']); I get the format I want.
According to FB docs, you can specify any URL you wish by populating the SHARE_URL a tag attribute:
<a name="fb_share" type="button" share_url="<?php echo $url['dirname'] ?>"></a>
By the way, what you are referring to is a canonical url, trimming this:
http://www.domain.com/gb/news/12/13311/the-name-of-article-written-in-greek.htm
To this:
http://www.domain.com/gb/news/12/13311/
The beauty of canonical urls is that they will not change, even though you decide to change keywords in the pretty url version. Useful for sitemaps.
You can use the FaceBook OG (open graph) tags to tell facebook what the "real" url is of the page. If you're serious about facebook sharing, you should be using those already. Put these in your
<meta property="og:title" content="Titeel Goes Here"/>
<meta property="og:url" content="URL goes here"/>
Verify what Facebook sees here: https://developers.facebook.com/tools/debug. You can also add a thumbnail image, and admin (so you can better see the likes and who shared).

Categories