![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#2
IP: 222.184.76.22
|
|||
|
|||
|
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: Code:
{$smarty.const.DOC_ROOT}/detail/link-{$link.ID}.html
Code:
{$smarty.const.DOC_ROOT}/{$link.CATEGORY_URL|escape|trim}
{$link.TITLE|escape|trim|replace:' ':'-'}-{$link.ID}.html
FIND: Code:
preg_match ('#(.*)link(_|-)(\d+)\.htm[l]?$#i', request_uri(), $matches);
Code:
preg_match ('#(.*)(_|-)(\d+)\.htm[l]?$#i', request_uri(), $matches);
LOCATE the code between <IfModule mod_rewrite.c> and </IfModule> REPLACE BY: Code:
# 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>
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: Code:
{$smarty.const.DOC_ROOT}/{$link.CATEGORY_URL|escape|trim}
{$link.TITLE|escape|trim|strtolower|replace:' ':'-'}-{$link.ID}.html
Code:
RewriteCond %{REQUEST_URI} ^(.*)/detail/link-(.*)\.html$
RewriteRule ^(.*)$ http://www.yourdirectory.com/ [R=301,L]
ENJOY! |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 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 |