年年我发



返回   年年我发 > 网站建设 > 建站交流 > Web Directory
用户名
密码
 
注册账号 论坛帮助 会员列表 日历事件网赚工具 标记版面已读

回复
 
主题工具 搜索本主题 显示模式
  #1   IP: 222.184.76.22
旧 2007-07-01, 11:12 PM
topvip topvip 当前离线
超级版主
 
注册日期: 2006-01-04
帖子: 611
精华: 11
现金: 4785 元
资产: 7233 元
声望: 10 topvip 正向着好的方向发展
默认 phpld seo friendly pages

If you are looking for the phpld seo friendly details pages mod click here.

With this small modification you can have seo friendly pages for the top links, latest links and latest articles. Actually this is already done in the .htaccess and all you have to do is to update your template to point to these pages. The file to modify is usually top-bar.tpl

FIND: {$smarty.const.DOC_ROOT}/index.php?list=latest
REPLACE BY: {$smarty.const.DOC_ROOT}/latest-links.html

FIND: {$smarty.const.DOC_ROOT}/index.php?list=latestarticles
REPLACE BY: {$smarty.const.DOC_ROOT}/latest-articles.html

FIND: {$smarty.const.DOC_ROOT}/index.php?list=top
REPLACE BY: {$smarty.const.DOC_ROOT}/top-hits.html
回复时引用此帖

wellcome to www.0058.net
  #2   IP: 222.184.76.22
旧 2007-07-01, 11:22 PM
topvip topvip 当前离线
超级版主
 
注册日期: 2006-01-04
帖子: 611
精华: 11
现金: 4785 元
资产: 7233 元
声望: 10 topvip 正向着好的方向发展
默认 phpld SEO friendly details pages

With this simple mod you can include any field from the link table in the URL of the details page. So instead of having a URL that looks like http://rakcha.com/phpld//link-18.html you can have it look like
http://www.rakCha.com/phpld/Directories/enQuira-directory-18.html

Implementation:
in link.tpl
FIND:

代码:
{$smarty.const.DOC_ROOT}/detail/link-{$link.ID}.html

REPLACE BY (this is 1 line, there is no line break!):

代码:
{$smarty.const.DOC_ROOT}/{$link.CATEGORY_URL|escape|trim} {$link.TITLE|escape|trim|replace:' ':'-'}-{$link.ID}.html

in detail.php
FIND:

代码:
preg_match ('#(.*)link(_|-)(\d+)\.htm[l]?$#i', request_uri(), $matches);

REPLACE BY:

代码:
preg_match ('#(.*)(_|-)(\d+)\.htm[l]?$#i', request_uri(), $matches);

in .htaccess
LOCATE the code between <IfModule mod_rewrite.c> and </IfModule>
REPLACE BY:

代码:
# URL rewrite rules <IfModule mod_rewrite.c> RewriteEngine On #Make sure RewriteBase points to the directory where you installed phpLD. #Example: "/phpld" if your installation is in a "phpld" subdirectory. RewriteBase / ##Latest Links Rewrite RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^latest-listings\.htm[l]?$ index.php?list=latest [QSA,NC,L] ##Top Hits Rewrite RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^popular-listings\.htm[l]?$ index.php?list=top [QSA,NC,L] ##Latest Articles Rewrite RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^latest-articles\.html$ index.php?list=latestarticles [QSA,NC,L] ##Pagination Rewrite RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule (.*)page-[0-9]+\.html$ index.php/?p=$2 [QSA,NC,L] ##Article Page Rewrite RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule (.*)articles/article-(.*)\.htm[l]?$ article.php [QSA,NC,L] ##Details Link Page Rewrite RewriteRule %{REQUEST_URI} !page-[0-9]+\.html?$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)\.html$ detail.php [NC,QSA,L] ##Category redirect RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)$ index.php [QSA,L] </IfModule>

That’s it, you are done!

Extension: If you want to use any other field of the PLD_LINK Table, say you have a custom field for keywords named KEYWORDS, you can add {$link.KEYWORDS|escape|trim|replace:' ':'-'} to the URL.

PS: If you want to convert the added fields like $link.TITLE to lower case, you will have to add strtolower to it. The URL becomes:

代码:
{$smarty.const.DOC_ROOT}/{$link.CATEGORY_URL|escape|trim} {$link.TITLE|escape|trim|strtolower|replace:' ':'-'}-{$link.ID}.html

PS2: To redirect old pages to your directory home, add the following in .htaccess

代码:
RewriteCond %{REQUEST_URI} ^(.*)/detail/link-(.*)\.html$ RewriteRule ^(.*)$ http://www.yourdirectory.com/ [R=301,L]

It is not possible to redirect old pages to new pages as the listing title or category are not available at the htaccess level. However this will not cause a problem as old pages will be promtply deindexed thanks to the 301 redirect to the homepage, and new pages indexed without causing duplicate content.
ENJOY!
回复时引用此帖
回复


当前查看此主题的会员: 1 (0 位会员和 1 位游客)
 
主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

论坛启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码
论坛跳转

相似的主题
主题 主题作者 版面 回复 最后发表
What The Google Patent Means For SEO smiling 搜索引擎市场营销研究 0 2006-05-14 06:59 PM
Comprehensive List of SEO Tools topvip 搜索引擎市场营销研究 0 2006-03-23 01:16 AM
Successful Site in 12 Months with Google Alone sunshine 搜索引擎市场营销研究 0 2006-02-27 09:27 PM
Beware the Google Death Penalty --Google’s Advice for Choosing an SEO (2) sunshine 搜索引擎市场营销研究 0 2006-02-26 06:26 PM
Understanding SEO for vBulletin lingerie vBulletin技术交流 0 2006-02-06 11:35 AM


所有时间均为北京时间. 现在的时间是 07:34 AM, Free Patent & Patent Ideas


Powered by vBulletin 3.5.2 Chinese Exhibition Happy New Year
©2000 - 2008,Jelsoft Enterprises Ltd  Desiccant Molecular Sieve Weight Loss Bentonite Trade Manager