Facebookの「いいね」ボタンを使用しているvBulletinボードで、本当に、本当に、本当に奇妙な問題が発生しています。私のスレッドテンプレートでは、bodyタグ内にある次のコードを使用しています。
<td class="vbs_forumdata alt1">
<div id="fb-root"></div>
<script type="text/javascript">(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");</script>
<div id="thread_sharing_content_facebook">
<div class="fb-like" data-href="{vb:raw sharingurl}" data-layout="button_count" data-send="false" data-show-faces="false" data-width="90"></div>
</div>
</div>
</td>
テンプレートがvBulletinエンジンによって処理されるとすぐに、変数{vb:rawsharingurl}がスレッドの正規URLに置き換えられます。これは次のようになります。
http://MYDOMAIN/threads/THREADID-THREADTITLE
例えば:
http://www.mydomain.com/threads/1-Hello-Community
スレッドページのHTMLソースを見ると、すべてが意図したとおりに機能しているようです。
<td class="vbs_forumdata alt1">
<div id="fb-root"></div>
<script type="text/javascript">(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");</script>
<div id="thread_sharing_content_facebook">
<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"></div>
</div>
</div>
</td>
しかし、「いいね」ボタンをクリックしてスレッドページを共有すると...ドラマが表示されます。
スレッドページの元のURLはめちゃくちゃになって、次のようなものに変換されます。
http://MYDOMAIN/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/threads/THREADID-THREADTITLE
なぜ私がその奇妙な問題を抱えているのか誰もが知っていますか?私が自分でそれを理解しようと考えていた唯一のことは、いくつかの書き換えルールを含む私のhtaccessファイルです。これはほとんどvBulletinのデフォルトのものです...しかし、とにかく、ここにあります:
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]
編集:FacebookのURLデバッガーを使用してみました...
スクレープ情報
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
修正が必要な重大なエラー
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.
修正が必要なエラー
Too Many Redirects: URL redirected too many times. Please reduce the number of redirects.
修正する必要があるボタンの警告のように
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.
修正する必要のあるOpenGraphの警告
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.
オブジェクトのプロパティ
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
リダイレクトパス
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
最終的なURLは太字で示されています(これは、メタデータを抽出しようとしたURLです)。
お願いします、お願いします...助けてください!