[archive] phpBB SEO Advanced mod Rewrite V 0.0.2

phpBB2 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting categories, forums and topic titles in their URLs.

Moderator: Moderators

[archive] phpBB SEO Advanced mod Rewrite V 0.0.2

Postby dcz » Thu May 25, 2006 8:22 pm

WARNING
    0.2.0 is out : To update please read this thread.

    What follows is kept for archive.

    0.0.2 support will continue for some time for 0.0.2 user, until they update.

    Do not use this version if you are first installing this mod.

---------------------------------------------------------------------------------------
[DEV] phpBB SEO Advanced mod Rewrite V 0.0.2 - UPDATED

Before you do anything :

    Please read carefully this post, you will save time and will not risk to jeopardise your web-site's PageRanking.


Under construction Topic.

From now on, the English versions will see the profiles URL to be : memberxx.html (membrexx.html in the French one).

This mod is working fully with phpBB vanilla (unmodded), special patch may be required for some mods, like simple sub forum. Many of them already exist here.

You should think about which solution will best fit your forum project before you install any of the three phpBB SEO mod Rewrite.

As well you should think about your robots.txt as well as about the www prefix issue.

The mx Google Siteamps and mx Sitmaps are, off course, compatible, useful and a requirement to help out Search Engines to Crawl you site well.


You can as well find out a lot of interesting Search Engine Optimization (SEO) parameters thanks to our phpBB SEO webmaster Tools

You should perform test locally or on a test server before you use this setup on a live site. This will prevent many small path issues in .htaccess from becoming too stressing for you ;)

To load mod Rewrite with Easyphp :
Open EasyPHP1-8\conf_files\httpd.conf and uncomment
(get rid of the "#" at the beginning of the required lines) those two lines :

Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so


And :

Code: Select all
AddModule mod_rewrite.c


Don't forget to install the Cyber alien Guest session mod or any other SID removal method you may prefer.


Code: Select all
##############################################################
## MOD Title:       phpBB SEO Advanced mod Rewrite
## MOD Author:       dcz <n/a> http://www.phpbb-seo.com/
## MOD Description:    This mod makes static URLs for phpBB
##          Please read the author notes BEFORE using this mod.
##          Check http://boards.phpbb-seo.com/phpbb-mod-rewrite/phpbb-seo-advanced-mod-rewrite-vt43.html
##          for the latest version or to get help with this MOD.
##
## MOD Version:    0.0.2
##
## Installation Level:    (Advanced)
## Installation Time:    5 Minutes
## Files To Edit:    (6)
##         .htaccess,
##         index.php,
##         viewforum.php,
##         viewtopic.php,
##         search.php,
##         overall_footer.tpl
## Included Files: n/a
##############################################################
## Author Notes:
##
## Please note that this version will not inject topic titles in post's URLS. This is to make it easier
## to disallow them with our robots.txt file, since those are duplicates any way.
## The last post link on forum Index is now statically mod rewritten postxx.html.
## People whilling to keep the old way, even though phpBB SEO does not recomand it, should read the note
## in the release thread bef  ore implementing the required changes or asking for support.
##
## This mod requires running Apache Server with mod_Rewrite module loaded.
##
## This mod requires the Cyber Alien guest session mod (http://www.phpbbstyles.com/viewtopic.php?t=357) or any other SID
## removal method you may prefer.
##
## With this mod, your phpBB URL will change :
##
##   index.php?c=xx               =>   cat-title-vcxx.html
##
##   viewforum.php?t=xx            =>   forum-title-vfxx.html
##
##   viewforum.php?t=xx&start=xx         =>   forum-title-vfxx-yy.html
##
##   viewtopic.php?t=xx               =>   topic-title-vtxx.html
##
##   viewtopic.php?t=xx&start=xx         =>   topic-title-vtxx-yy.html
##
##   viewtopic.php?p=xx               =>   postxx.html
##
##   profile.php?mode=viewprofile&u=xx    =>   memberxx.html
##
## This mod has nothing in common with other phpBB mod rewrite, it will perform the URL rewriting
## without using ob_start() nor adding any SQL. It is thus faster and not messing anymore whith Gun-Zip nor with the html link format,
## and will not output any pagination duplicates.
##
## Short URL feature : everything in topic title in between "[" and "]" won't be injected in URL.
##   Example :
##   This topic title : "[SOMETHING] The Topic Title" will correspond to this URL : "the-topic-title-vtxx.html"
##
## Bad Title handling :
##   Example :
##   This topic title : """"??Véry bâd tïtle handling"[hehe]!!!" will correspond to this URL : "very-bad-title-handling-vtxx.html"
##
## WARNING : Topic title injection in URL can be hard to deal with depending on the type of subjects your
## forum is about. In almost all cases phpBB SEO recommend the use of the phpBB SEO mixed mod Rewrite instead.
## Please read : http://boards.phpbb-seo.com/phpbb-seo-toolkit/phpbb-seo-mod-rewrites-vt66.html
##
## This mod is and will be compatible to all phpBB SEO modules, specific install instructions may apply.
## phpBB SEO will provide patches to allow for other URL standards support upon request,
## so that everyone can take advantage of the phpBB mod Rewrites enhancement without jeopardising his Page-Ranking.
##
## Migrating from another mod Rewrite is as well possible but should be done with care to make sure you won't loose Page-Ranking.
##
####
## 0.0.1 => 0.0.2 Update : Required changes to be found in 0.0.1_0.0.2_Advanced_Update.txt
###
##
## LICENSE:
##
## We, phpBB SEO, have decided to license this mod under the RPL Licence ( http://www.opensource.org/licenses/rpl.php )
## which states you cannot remove the phpBB SEO credits and if you make any modifications you have to resubmit them
## to phpBB SEO for inclusion into this package again. You can read the license for yourself for further info.
##
## You can of course use this mod without any more limitations than those stated here and in the licence.
##
## At least a link ( http://www.phpbb-seo.com/ ) is required on every web site using this mod, or,
## if your web site does not comply with what phpBB SEO can link to, one proven link within a
## general audience hard link directory of your choice not already listing phpBB SEO.
## For more details about possible exeptions, please contact a phpBB SEO administrator (primarily SeO or dcz).
##
## Failure to comply will jeopardize support.
##
##############################################################
## MOD History:
##
##   2006-06-20 - 0.0.2
##      - Will NOT inject topic titles in post(viewtopic.php?p=xx) URLs, to make it possible to disallow
##        with robots.txt. Will be mod rewritten in a static manner instead.
##      - Optimized the format_url() function, just doing the same job faster.
##      - Added highlight fix in search.php adn fixed a small bug in search results (results posts)
##      - Optimized the append_sid() filtering.
##
##   2006-05-25 - 0.0.1
##      - First Beta Version
##
##   2006-03-01 - 0.0.0
##      - Initial beta testing phase
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################



Download phpBB SEO Advanced mod Rewrite V 0.0.2


The robots.txt :

The robots.txt file must be uploaded in your domain's root folder.

You must obviously change phpbb/ with your real phpBB installation folder (or with nothing if it's installed in the root).

Code: Select all
User-agent: *
Disallow: /phpbb/viewtopic.php
Disallow: /phpbb/viewforum.php
Disallow: /phpbb/index.php?
Disallow: /phpbb/posting.php
Disallow: /phpbb/groupcp.php
Disallow: /phpbb/search.php
Disallow: /phpbb/login.php
Disallow: /phpbb/privmsg.php
Disallow: /phpbb/post


This is the minimum required for bots to only consider the rewritten URLs.
The index.php? is absolutely normal and does not disallow index.php ;)

After this you can add :

Code: Select all
Disallow: /phpbb/member
Disallow: /phpbb/profile.php
Disallow: /phpbb/memberlist.php
Disallow: /phpbb/faq.php


If you don't want to put too much weight on those, by the way attractive to spammers. Will save some "useless" bot visits as well.

You may need to implement additional disallows if you changed URL standard for example.

French support for this mod.
--------------------------------------------------------------------------------------
Do not forget :

http://boards.phpbb-seo.com/phpbb-mod-r ... 5.html#926

dcz wrote:I am currently working on enhancing phpBB link and to organise the phpBB SEO Toolkit. I thought the nav link handling should be added to the phpBB SEO mod rewrites themselves, as it require very little changes.

Here are the code changes that will be added to the next version, you can implement them now they are final ;)

They'll make sure your nav links are mod rewritten and will get rid of the next and previous topic links for guest, as they are duplicates.

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#

includes/function.php


#
#-----[ FIND ]------------------------------------------
#

                  $nav_links['chapter forum'][$forum_rows[$j]['forum_id']] = array (
                        'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id']),

#
#-----[ REPLACE WITH ]------------------------------------------
#


                  $nav_links['chapter forum'][$forum_rows[$j]['forum_id']] = array (
                     // www.phpBB-SEO.com SEO TOOLKIT BEGIN
                        //'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id']),
                        'url' => append_sid(format_url($forum_rows[$j]['forum_name']) . "-vf" . $forum_rows[$j]['forum_id'] . ".html") ,
                        // www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#


viewtopic.php


#
#-----[ FIND ]------------------------------------------
#

$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=previous");
$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=next");

//
// Mozilla navigation bar
//
$nav_links['prev'] = array(
   'url' => $view_prev_topic_url,
   'title' => $lang['View_previous_topic']
);
$nav_links['next'] = array(
   'url' => $view_next_topic_url,
   'title' => $lang['View_next_topic']
);


#
#-----[ REPLACE WITH ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ($userdata['session_logged_in']) {
$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=previous");
$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=next");

//
// Mozilla navigation bar
//
$nav_links['prev'] = array(
   'url' => $view_prev_topic_url,
   'title' => $lang['View_previous_topic']
);
$nav_links['next'] = array(
   'url' => $view_next_topic_url,
   'title' => $lang['View_next_topic']
);
}
// www.phpBB-SEO.com SEO TOOLKIT END

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


;)
Last edited by dcz on Tue Jan 23, 2007 1:29 am, edited 4 times in total.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21406
Joined: Fri Apr 28, 2006 9:03 pm

Advertisement

Postby JanoF » Tue May 30, 2006 4:14 pm

Why I near sended contributions let fly original message phpBB et non on SEO message???
Last edited by JanoF on Tue May 30, 2006 8:29 pm, edited 1 time in total.
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby dcz » Tue May 30, 2006 4:18 pm

JanoF wrote:Why I near sended contributions let fly original message phpBB et non on SEO message???


Sorry I don't understand, could you post or PM a link that demonstrate what you are trying to say ?

And please try to make yourself more clear as well ;)

What did you installed, which mod rewrite, which mods etc ...

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21406
Joined: Fri Apr 28, 2006 9:03 pm

Postby JanoF » Tue May 30, 2006 10:28 pm

link on post no rewrite on index
http://janof.yw.sk/2.jpg

link on post is rewrite
http://janof.yw.sk/1.jpg

???
Last edited by JanoF on Tue May 30, 2006 10:53 pm, edited 1 time in total.
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby dcz » Tue May 30, 2006 10:53 pm

Ho I see now, thanks ;)

Some how images made it, I'd appreciate if you post smaller images or links to bigger instead of this, but at least it is clear.


So, the thing here is those URL are post's URL (viewtopic.php?p=xx), and they are duplicates of the topic URL (viewtopic.php?t=xx), the one we are Search Engine Optimizing with the phpBB SEO mod Rewrites.

So they should be disallowed by the robots.txt. Actually, I just left the link as is in the forum index to make it easier to disallow and missed the viewforum's one.

The Best here I think would be not to show the link to guest so that bots do not see it.

You can do it like this :

Open :

Code: Select all
index.php



Find :


Code: Select all
                        'LAST_POST' => $last_post,


Replace with :

Code: Select all
                        'LAST_POST' => ($userdata['session_logged_in']) ? $last_post : '',


Open :

Code: Select all
viewforum.php


Find :

Code: Select all
         'LAST_POST_IMG' => $last_post_url,



Replace with :


Code: Select all
         'LAST_POST_IMG' => ($userdata['session_logged_in']) ? $last_post_url : '',


This way bots won't see those, being duplicates anyway.

I think I'll add this on in the next release.

One could want to rewrite those instead, but the last post topic title is not available in index.php and would have to be queried for in an additional table, meaning consuming quite some server resources.

If you want to keep the vanilla url for the last post link, you can :

Open :

Code: Select all
viewforum.php



Find :

Code: Select all
      $last_post_url = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $topic_rowset[$i]['topic_last_post_id']) . '#' . $topic_rowset[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>';


Before Add :

Code: Select all
      // phpBB-SEO.com SEO TOOLKIT BEGIN
      $seo_topic_name = FALSE;
      // phpBB-SEO.com SEO TOOLKIT END


Actually I am thinking that a good thing could be to rewrite those links in a static manner.

Will think about this.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21406
Joined: Fri Apr 28, 2006 9:03 pm

Postby JanoF » Wed May 31, 2006 12:15 am

And where oneself give draw download this modification who have you on [LINK REMOVED] ???
Because there you it all pretty he shows like this like me

Use this modification phpBB google keyword URLs 2.3.1 but she non-he shows right rewrite on contributions, he shows me there image-vpXX.html and should it this screen topic title-vpXX.html :cry:
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby dcz » Wed May 31, 2006 12:28 am

JanoF wrote:And where oneself give draw download this modification who have you on [LINK REMOVED] ???
Because there you it all pretty he shows like this like me

Use this modification phpBB google keyword URLs 2.3.1 but she non-he shows right rewrite on contributions, he shows me there image-vpXX.html and should it this screen topic title-vpXX.html :cry:


As I told you, the topic title is not available in phpBB index, you'd have to change the sql query and to perform it on an additional table, which, depending on your server can be quite a pain.

You don't lose that much not showing those two links, mx Sitemaps and mx Google Sitemaps will provide links to the last pages of every topics ... So indexing here is not the problem ;)
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21406
Joined: Fri Apr 28, 2006 9:03 pm

Postby JanoF » Wed May 31, 2006 12:35 am

I I have got to phpBB, I have not mx portal, boot no possible this image-vpXX.html some change to topictitle-vpXX.html ? Or it will be sometime in latter version??
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby dcz » Wed May 31, 2006 12:36 am

JanoF wrote:I I have got to phpBB, I have not mx portal, boot no possible this image-vpXX.html some change to topictitle-vpXX.html ? Or it will be sometime in latter version??


The phpBB SEO Mod rewrite are meant for phpBB ;)

And who know where we will end up to go :D
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21406
Joined: Fri Apr 28, 2006 9:03 pm

Postby JanoF » Wed May 31, 2006 12:45 am

Yes, I can that this be game phpBB. I this modification phpBB google keyword URLs 2.3.1 utilize already around 1/2 year. Is going me only in it that rewrite on contributions is in form imago-vpXX.html at which logically should exist topictitle-vpXX.html.
You don't know then somehow help that I am towed took out this imago and replace this topictile ?
My address is http://www.example.com/image-vp4.html and should it there exist http://www.example.com/my-topic-vp1.html but no this like this, how oneself this give then correct????
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby dcz » Wed May 31, 2006 12:49 am

Sorry but again, I don't understand you.
Maybe you should try to get helped to translate what you want to say in English.

As well, I think you should start a new topic in this forum to talk about your particular problem.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21406
Joined: Fri Apr 28, 2006 9:03 pm

Postby sceltic » Wed May 31, 2006 1:49 pm

There seems to be a bug

*it could be a simple sub forums problem*

On viewtopic with the keyword urls

the breadcrumbs main forum also becomes the keyword of the topic

should be
index > mainforum > subforum

Code: Select all
index/ > forumname-vf1.html > subforumname-vf2.html

this works OK on index and forumview


But on viewtopic it becomes

index/ > subforumname-vf1.html > subforumname-vf2.html
sceltic
PR0
PR0
 
Posts: 55
Joined: Thu May 04, 2006 4:07 pm

Postby dcz » Wed May 31, 2006 3:09 pm

Actually, it is a sub forum issue, so please start a new topic in the phpBB mod Rewrite Forum and we'll find a nice patch for this ;)
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21406
Joined: Fri Apr 28, 2006 9:03 pm

Postby dcz » Wed Jun 21, 2006 1:19 pm

Updated to 0.0.2

Updating is very easy and will improve performance.

I decided not to inject topic titles in post's url (viewtopic.php?p=xx) to allow to disallows them with the robots.txt file, because they are duplicates of the topic (viewtopic.php?t=xx) and should not be optimized too much.

Then, the last post link in index will now be statically rewritten, necessary redirection in update file ;)

If you migrated from the webmedic rewrite mod and kept the "'" changed to nothing, then you'll need to add this in the format_url() function's code in includes/functions.php.

Find:

Code: Select all
function format_url($url)
{


After add :

Code: Select all
   $url = str_replace ("'", "", $url);


If not "'" will be changed to "-" in URLs when used in titles.

One could as well want to keep the topic title injection in post URLs, but as I don not recommend it, I'll wait for requests ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21406
Joined: Fri Apr 28, 2006 9:03 pm

Postby Hannibal_King » Sat Jun 24, 2006 6:00 pm

please, can someone help with this?

on my forum, if i enter som forum, i dont want there SITENAME/FORUM TITLE, but only FORUM TITLE and if i enter topic, i dont want there SITENAME/TOPIC TITLE but only TOPIC TITLE, how to make this? if you dont understand me, go to pcforum.sk :)
Hannibal_King
PR0
PR0
 
Posts: 78
Joined: Thu Jun 22, 2006 1:34 pm

Next

Return to phpBB2 Advanced mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests