Recent Topics

1 Oct 16, 2012 18:01    

My posts facebook likes got reset to zero after moving the blog to subdomain.

I always used domain.com/index.php?p=id for fb like so that the hrefs are stable and to prevent the above actually, but it didnt it seems.

Fb traces the url to get the nice url and gets that as og:url. I guess i could get the counts back to normal by defining og:url manually with a str_replace.But i cant think of a way for the post loop

2 Oct 24, 2012 03:35

Here's the function you can use in _skin.class.php to extract URL parts

function add_og_url()
{
	global $ReqURL, $ReqHost, $ReqURI;
	if( preg_match('~^https?://(?<blogname>[^.]+)\.[^/]+/(?<prefix>[^/]+)/(?<parent>[^/]+/)?(?<cat>[^/]+/)((?<post>[^?]+))?~i', $ReqURL, $parts) )
	{
		$query = @$_SERVER['QUERY_STRING'];
		$fb_url = 'http://tilqi.com/'.$parts['blogname'].'.php/';
		if( !empty($parts['cat']) )
		{
			$fb_url .= $parts['cat'];
		}
		if( !empty($parts['post']) )
		{
			$fb_url .= $parts['post'];
		}
		if( !empty($query) )
		{
			$fb_url .= '?'.$query;
		}

		add_headline('<meta property="og:url" content="'.format_to_output( $fb_url, 'htmlattr' ).'" />');
	}
}

3 Oct 29, 2012 07:26

for anyone reading this, turns out, there is no way to "transfer" your likes when you change your url structure.

4 Nov 11, 2012 17:25

Hey, I forgot that we can add redir=no param. Try it with $fb_url

6 Nov 16, 2012 00:23

blueyed wrote:

@tilqicom: you can transfer likes, basically by keep using the old og:url: http://facebook.stackoverflow.com/a/10152342/15690

I just did that with a platform where the domain changed.

Well, sam2kb helped adding old meta but because of the redirect it did not work.
He did say above something about a redir param but i have no idea what he meant by that, and what i should do

I mean isnt there a way to let facebook record og:url as index.php?pid and dont get involved with pretty urls ?

7 Nov 16, 2012 14:58

Sure, you can put whatever in og:url - however, when moving domains/url's, you want to keep the previous one.

I am not sure if b2evo adds og:url itself in default templates etc..

I just came across this thread and wanted to leave a pointer at the fix for it.

8 Nov 16, 2012 23:30

Thanks for the tip, checked that topic but i am not sure what to do

9 Nov 17, 2012 05:22

With "redir=no" you can use any valid URL b2evo will not redirect you to canonical URL.

Say, you can use index.php?p=444&redir=no and you won't be redirected to index.php/post-title

So as suggested above, try meta og:url with your old b2evo URLs ending on "redir=no"

10 Nov 17, 2012 05:50

sam2kb wrote:

With "redir=no" you can use any valid URL b2evo will not redirect you to canonical URL.

Say, you can use index.php?p=444&redir=no and you won't be redirected to index.php/post-title

So as suggested above, try meta og:url with your old b2evo URLs ending on "redir=no"

well, appending index.php?p=id&redir=no causes invalid request for me:

http://tilqi.com/index.php?p=1425&redir=no

and /permalink&redir=no causes a 404 (which i redirect to home).

12 Nov 26, 2012 17:49

Oh, i was missing blog=x there.It throws a warning though:


Open Graph Warnings That Should Be Fixed
Mismatch og:url and canonical url	og:url tag in the header is not the same URL as rel='canonical' link in the html.

Seems like i will lose some more likes, but on the bright side, i will finally be able to fix my og:url for future without any dependency, regardless of permalink, blog name, subdomain etc. etc.

Alex wrote:

This one works, also try index.php with blog=x
http://www.tilqi.com/resimli-sozler.php?p=1425&amp;redir=no

XX is the ID for &quot;resimli-sozler&quot; blog
http://www.tilqi.com/index.php?p=1425&amp;blog=XX&amp;redir=no


Form is loading...