PbDigg程序的SEO优化

九月 2nd, 2008 发布于 网络推广实战

Pbdigg是不错的Digg程序,也做不少SEO方面的优化,当然还是有一些不足之处,比如show,category不可更改,如果做英文站,URL带关键词是很有排名优势的,所以我们可以做进一步的修改。

主要修改目录的样式,原来是category/1这样的,改为category/1/这样的。当然category也可以改为任意字符,另外把原来的/show/xxxx.html改为/xxxx/1/这样权重较高的方式。

我用的是DreamHost以及梦游的服务器,Web服务器都是Apache的。

原来的.htacess如下:

# 打开 RewriteEngine 模式
RewriteEngine On

# 修改以下语句中的 /pbdigg2 为你的PBDIGG安装目录地址,如果程序放在根目录中,请将 /pbdigg2 修改为 /
RewriteBase /

# Rewrite 系统规则请勿修改 PBDIGG 2.0 正式版

RewriteRule ^index\.html(&page=([0-9]+))?$ index.php?page=$2
RewriteRule ^category/([0-9]+)(&page=([0-9]+))?$ category.php?cid=$1&page=$3
RewriteRule ^user/([0-9]+)(&page=([0-9]+))?$ user.php?uid=$1&page=$3
RewriteRule ^show/([0-9]+)\.html(&page=([0-9]+))?$ show.php?tid=$1&page=$3

 

改为

# 打开 RewriteEngine 模式
RewriteEngine On

# 修改以下语句中的 /pbdigg2 为你的PBDIGG安装目录地址,如果程序放在根目录中,请将 /pbdigg2 修改为 /
RewriteBase /

# Rewrite 系统规则请勿修改 PBDIGG 2.0 正式版

RewriteRule ^index\.html(&page=([0-9]+))?$ index.php?page=$2
RewriteRule ^category/([0-9]+)/(&page=([0-9]+))?$ category.php?cid=$1&page=$3
RewriteRule ^member/([0-9]+)/(&page=([0-9]+))?$ user.php?uid=$1&page=$3
RewriteRule ^article/([0-9]+)/(&page=([0-9]+))?$ show.php?tid=$1&page=$3

修改/include/global.func.php文件为如下

}
function rewriteIndex($page, $ext)
{
 global $_PBENV, $pb_rewriteext;
 return ‘<a href=”‘.$_PBENV['PB_URL'].’index.’.$pb_rewriteext.”.($page ? ‘&amp;page=’.$page : ”).’”‘.($ext ? ‘ ‘ : ”).stripslashes($ext).’>’;
}
function rewriteCate($cid, $page, $ext)
{
 global $_PBENV;
 return ‘<a href=”‘.$_PBENV['PB_URL'].’category/’.$cid.’/”>’;
}
function rewriteThread($tid, $page, $ext)
{
 global $pb_rewriteext, $_PBENV;
 return ‘<a href=”‘.$_PBENV['PB_URL'].’article/’.$tid.’/”>’;
}
function rewriteUser($uid, $page, $ext)
{
 global $_PBENV;
 return ‘<a href=”‘.$_PBENV['PB_URL'].’member/’.$uid.’/”>’;
}
 

结束。



评论暂缺

You must be logged in to post a comment.