2012年7月4日星期三

URL rewrite PHPBB3 static pseudo static

PHPBB as an open source project for the optimization of the BBS, its strict code style, high performance mechanism logic has been under global customers welcome, is also the source code reading course indispensable section: D (nfl jersey)

Just because it is the focus of the PHP programming, so in other aspects of lay particular stress on and not too high. Such as SEO. Here is my personal problems SEO chat use experience. 

Admittedly PHP-SEO-MOD little, but too bloated.
Open PHPBB3 program. Below we to relative path to illustrate: 

BBS edition piece was 

Viewforum. PHP? F = 3 this 3 am forums Numbers
The expectations of the URL for the area
Viewforum-HTML 

Compare of the: 

Quote viewforum. PHP? F = 3
Viewforum-HTML 

The same view of the optimization of the URL for the post contrast:
Quote viewtopic. PHP? F = 3 & t = 1607
Viewtopic-3-1607 HTML(cheap nfl jersey)
Now to modify source code: 

Open viewforum. PHP 

In 608 about the following code do find: 


$view_topic_url = append_sid (" {$phpbb_root_path} viewtopic. $phpEx ", 'f ='. (($row [' forum_id '])? $row [' forum_id '] : $forum_id). The '& t ='. $topic_id); 

To: 

$view_topic_url = ". / viewtopic. "'-'. (($row [' forum_id '])? $row [' forum_id '] : $forum_id). ''. $topic_id. '. HTML ';


Open: includes/functions_display. PHP 

About 302 lines: 


$u_viewforum = append_sid (" {$phpbb_root_path} viewforum. $phpEx ", 'f ='. $row [' forum_id ']); 

To: 

$u_viewforum = ". / viewforum. "'-'. $row [' forum_id ']. '. HTML ';
About 526 lines:
'U_VIEW_FORUM' = > append_sid (" {$phpbb_root_path} viewforum. $phpEx ", 'f ='. $parent_forum_id)) 

To: 

'U_VIEW_FORUM' = > ". / viewforum. "'-'. $parent_forum_id. '. HTML ')
About 537 lines:
'U_VIEW_FORUM' = > append_sid (" {$phpbb_root_path} viewforum. $phpEx ", 'f ='. $forum_data [' forum_id '])) 

To: 

'U_VIEW_FORUM' = > ". / viewforum. "'-'. $forum_data [' forum_id ']. '. HTML ')
OK, so simple. Than the PHP-SEO-MOD (let you get a headache module) much more simple. 



没有评论:

发表评论