目前我在一个页面上有3个评论框.该页面有三个显示不同内容的选项卡,每个选项卡内容都有自己的注释部分,与其他两个不同.
为了确保为每个选项卡加载唯一注释,我目前正在使用类似于:
<div class="fb-comments" data-href="http://webpage.com/index.html#tab1"
data-num-posts="2" data-width="470"></div>
<div class="fb-comments" data-href="http://webpage.com/index.html#tab2" ...
<div class="fb-comments" data-href="http://webpage.com/index.html#tab3" ...
Run Code Online (Sandbox Code Playgroud)
这适用于显示相关内容.但是,当有人回复其中一条评论时,原始评论员会在其fb个人资料中收到一个链接,该链接显示为:
http://webpage.com/index.html?fb_comment_id=fbc_26547577547547_477747457_3745757457435737#4574575475
问题是用户给出的这个链接没有显示相关的评论线程,甚至没有显示基于锚点的data-href评论框.也许最终的锚点正在绊倒显示器?如果是这样,是否有一个范例在一个页面上有不同的Facebook评论框?
感谢您解决这个烦人问题的任何帮助.
我目前在使用URL管理器和/或apache mod_rewrite时遇到问题,或者完全是其他问题.
如果将showScriptName设置为false,则导航到domain.com/login,domain.com/logout,domain.com/site/login等地址的行为方式都相同.它只显示主站点/索引,就好像我要导航到domain.com/eeofjew9j8jfdedfmewf(jibberish).
也许这是我的Yii设置的问题?以下是那些(对不起):
'components'=>array(
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'login'=>'site/login',
'logout'=>'site/logout',
'register'=>'users/register'
),
,...
Run Code Online (Sandbox Code Playgroud)
以下是我在www root中设置.htaccess的方法:
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
Run Code Online (Sandbox Code Playgroud)
我正在使用VPS服务器,因此我具有root访问权限,可以对apache进行任何更改.我检查了我的phpinfo并且mod_rewrite正在运行并启用.在我的apache配置中,我有我的www目录:
AllowOverride All
Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
Run Code Online (Sandbox Code Playgroud)
我已经通过3个不同的主机(godaddy,dreamhost和锂主机)在这个问题上摸不着头脑,所以我认为这是我的问题.既然我有VPS,我希望我能最终找出问题并解决它.