Note that there are some explanatory texts on larger screens.

plurals
  1. POLike Button, vBulletin and Mod Rewrite
    primarykey
    data
    text
    <p>I'm having a really, really, really weird problem on my vBulletin board using Facebook's Like Button. In my thread template I'm using the following code, which is located inside body tag:</p> <pre><code>&lt;td class="vbs_forumdata alt1"&gt; &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt;(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="//connect.facebook.net/en_US/all.js#xfbml=1";fjs.parentNode.insertBefore(js,fjs)})(document,"script","facebook-jssdk");&lt;/script&gt; &lt;div id="thread_sharing_content_facebook"&gt; &lt;div class="fb-like" data-href="{vb:raw sharingurl}" data-layout="button_count" data-send="false" data-show-faces="false" data-width="90"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/td&gt; </code></pre> <p>As soon as the template is processed by the vBulletin engine, the variable {vb:raw sharingurl} is replaced by the thread's canonical URL, that looks like this:</p> <pre><code>http://MYDOMAIN/threads/THREADID-THREADTITLE </code></pre> <p>For example:</p> <pre><code>http://www.mydomain.com/threads/1-Hello-Community </code></pre> <p>Looking at the HTML source of a thread page, everything seems to work as intended:</p> <pre><code>&lt;td class="vbs_forumdata alt1"&gt; &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt;(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="//connect.facebook.net/en_US/all.js#xfbml=1";fjs.parentNode.insertBefore(js,fjs)})(document,"script","facebook-jssdk");&lt;/script&gt; &lt;div id="thread_sharing_content_facebook"&gt; &lt;div class="fb-like" data-href="http://www.mydomain.com/threads/1-Hello-Community" data-layout="button_count" data-send="false" data-show-faces="false" data-width="90"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/td&gt; </code></pre> <p>But then, if I click on the Like Button to share the thread page... here comes the drama:</p> <p><img src="https://i.stack.imgur.com/2EFtf.jpg" alt="Drama"></p> <p>The original URL of the thread page is messed up transformed into something like:</p> <pre><code>http://MYDOMAIN/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/THREADID-THREADTITLE </code></pre> <p>Anyone knows why I'm getting that strange problem? The only thing I was thinking about trying to figure it out by myself, is my htaccess file which contains some rewrite rules. It's almost the vBulletin default one... but, anyway, here they are:</p> <pre><code>RewriteEngine On RewriteBase / // Block Bad Bots RewriteCond %{HTTP_USER_AGENT} [...] RewriteRule ^.*$ - [F,L] RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} !^www\..+$ [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^forums/.* forumdisplay.php [QSA] RewriteRule ^members/.* member.php [QSA] RewriteRule ^threads/.* showthread.php [QSA] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA] RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(.*)$ - [NC,L] RewriteRule ^(.*)$ - [R=404,L] </code></pre> <p><strong>EDIT: I tried using the Facebook URL debugger and...</strong></p> <p><em>Scrape Information</em></p> <pre><code>Response Code: 200 Fetched URL: http://www.mydomain.com/threads/1-Hello-Community Canonical URL: http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community </code></pre> <p><em>Critical Errors That Must Be Fixed</em></p> <pre><code>Could Not Follow Redirect Path: Using data from http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community because there was an error following the redirect path. </code></pre> <p><em>Errors That Must Be Fixed</em></p> <pre><code>Too Many Redirects: URL redirected too many times. Please reduce the number of redirects. </code></pre> <p><em>Like Button Warnings That Should Be Fixed</em></p> <pre><code>Admins And App ID Missing: fb:admins and fb:app_id tags are missing. These tags are necessary for Facebook to render a News Feed story that generates a high click-through rate. Like Button Tag Missing: og:title is missing. The og:title meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate. Like Button Tag Missing: og:type is missing. The og:type meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate. Like Button Tag Missing: og:image is missing. The og:image meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate. </code></pre> <p><em>Open Graph Warnings That Should Be Fixed</em></p> <pre><code>Inferred Property: The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property: The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property: The 'og:description' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property: The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags. </code></pre> <p><em>Object Properties</em></p> <pre><code>og:url: http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community og:type: website og:title: #Page Title# og:image: og:description: #Meta Description# og:updated_time: 1348134967 </code></pre> <p><em>Redirect Path</em></p> <pre><code>originale: http://www.mydomain.com/threads/1-Hello-Community rel="canonical": http://www.mydomain.com/threads/threads/1-Hello-Community rel="canonical": http://www.mydomain.com/threads/threads/threads/1-Hello-Community rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/1-Hello-Community rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/1-Hello-Community rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/1-Hello-Community rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community rel="canonical": http://www.mydomain.com/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/1-Hello-Community </code></pre> <p>Final URL is in bold (this is the URL we tried to extract metadata from).</p> <p>Please, please, PLEASE... help me out!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload