[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

Postby Hannibal_King » Sun Jun 25, 2006 4:45 am

if you dont understand me, i dont mean anything on the forum, only the title of the page
Hannibal_King
PR0
PR0
 
Posts: 78
Joined: Thu Jun 22, 2006 1:34 pm

Advertisement

Postby dcz » Sun Jun 25, 2006 9:12 am

I do don't worry, the answer is yes, it's possible and yes, there will soon be a mod do to so here, but it's sunday ;)

And how about you, do you ?

;)
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby Hannibal_King » Sun Jun 25, 2006 11:18 am

dcz wrote:And how about you, do you ?

;)

OK :oops:
Hannibal_King
PR0
PR0
 
Posts: 78
Joined: Thu Jun 22, 2006 1:34 pm

Postby dcz » Sun Jul 09, 2006 3:48 pm

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&view=previous");
$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&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&view=previous");
$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&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


;)
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby Peter77 » Thu Jul 13, 2006 5:31 am

Now with the upgrade we have this-as-a-topic.html and post1234.html#12345 .... this is not duplicates?
Peter77
phpBB SEO Team
phpBB SEO Team
 
Posts: 520
Joined: Wed May 10, 2006 9:46 am
Location: Michigan

Postby dcz » Thu Jul 13, 2006 2:06 pm

Well, yes it is, but before it was too.

Let me explain further.

At first, with 0.0.1, the last post looked like : this-as-a-topic-vpxx.html wich was as well a duplicate of the real topic URL being this-as-a-topic-vtyy.html.

The problem was it was impossible to disallow properly the first kind of post URLs, where here a simple :

Code: Select all
disallow: /post


Will do it for every post URLs at once.

Then, this is not to last for ever ;)
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby Hannibal_King » Sun Jul 23, 2006 6:18 am

i have a question, how can i change this:
memberXXX
vtXX
vfXX
?

i have tryied it in httachess but there was an error :(
Hannibal_King
PR0
PR0
 
Posts: 78
Joined: Thu Jun 22, 2006 1:34 pm

Postby dcz » Sun Jul 23, 2006 1:13 pm

Well, these can be changed, but you have to choose the standards cautiously.

For "member" and "post" it's very easy, you just have to change them to whatever in the .htaccess and in the append_sid() function in includes/sessions.php

For the dynamic anchors, "-vc", "-vf" and "-vt", they can be changed the same way, but you have to choose them well, not too long and they must be unique, one anchor per script (index.php, viewforum.php and viewtopic.php), meaning you won't be able to use the same one for all.

As well, this means you'll have to make sure every other mod is keeping you new standard, it does not matter for "post" and "member" but could on the other ones.

So, think about this before you make your choice, because, I plan to add support for many other modules that will thus be implemented with a compatible anchor with the officials so you'll have to check them and eventually tweak them to preserve future compatibility.

For example, I am about to release a mod rewrite for the smartor album, four more three letters rewrite anchors ("-ac", "-sp", "-ap" and "-sr").

Then, this would mean changing all URLs, like if you where migrating so you'd have to take precaution not to loose PageRank.

Why would you want to change those anyway (beside member and post eventually) ?
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby Hannibal_King » Mon Jul 24, 2006 6:27 pm

OK, i understand, so could it be like this?

vt - tema
vf - forum
post - prispevok
vc - vc
member - uzivatel
Hannibal_King
PR0
PR0
 
Posts: 78
Joined: Thu Jun 22, 2006 1:34 pm

Postby dcz » Mon Jul 24, 2006 7:35 pm

Well this means changing all of them.
I think we'd better directly use "-temaXX.html" but still I don't really get the interest of changing the anchors when injecting titles.

A simple way to force on keyword in the output would be to go for something like tema-vtxx.html at the end of every topic url and forum-vfXX.html for forums for example.

You would just have to edit sessions.php, changing "-vt" to "tema-vt" and "-vf" to "forum-vf". Same in mx Google Sitemaps files.

But this would end up creating duplicates as you'd change all your URLs.

I'd understand it better for the static part ( here "post" ) as it can be itself used as a keyword, but with title injection, the shorter the better for params I'd say.

If you where thinking about forum accessibility, work on your titles, I don't think any user would first rely on the url to find out it's either a topic or a forum he's watching ;)

++
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby Hannibal_King » Wed Jul 26, 2006 2:08 pm

dcz wrote:You would just have to edit sessions.php, changing "-vt" to "tema-vt" and "-vf" to "forum-vf". Same in mx Google Sitemaps files.

And how about to change the "-vt" to "-tema" and "-vf" to "-forum" ? i need this for my new forum, so i will not change any URLs...
Hannibal_King
PR0
PR0
 
Posts: 78
Joined: Thu Jun 22, 2006 1:34 pm

Postby dcz » Wed Jul 26, 2006 5:17 pm

Ho es for a new install, there is no problem doing so.

Just change all occurrences of "-vt" and "-vf" to "-tema" and "-forum" in sessions.php and the .htaccess.

You'll have to do the same for the mx Google sitemaps premodded files and that's it.

But in the future you'll always have to make sure you make the correct changes again (in new mods or updates).

++
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby Hannibal_King » Thu Aug 10, 2006 8:37 am

Hello,

i have a question, vwhy the links in viewonline.php is not rewrited? is it normal? because here it works fine... :(

Edit: and why all robots on my board are still on the index page? :cry: where could be the problem?
Hannibal_King
PR0
PR0
 
Posts: 78
Joined: Thu Jun 22, 2006 1:34 pm

Postby JanoF » Thu Aug 10, 2006 9:19 am

Hannibal_King wrote:Hello,

i have a question, vwhy the links in viewonline.php is not rewrited? is it normal? because here it works fine... :(
tu je pouzity iny rewrite ;) daj si viewonline.php do robots.txt a nemas problem, tu ide len o google, nie oto aby si mal pekne adresy ako taky Kuko :)

Code: Select all
Disallow: /viewtopic.php


a google to nebude indexovat ;)

Hannibal_King wrote:Edit: and why all robots on my board are still on the index page? :cry: where could be the problem?
problem mas v backlinkoch ;) cize odkazov ktore na teba odniekial odkazuju

http://www.google.sk/search?hl=sk&lr=&q ... orner.biz/

cize sa nediv ze induxuju tovj web ako lemry :) PR3 je tiez nic moc, PR4 je uz lepsie ale ani to nieje nejaka vyhra :)
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby dcz » Thu Aug 10, 2006 10:48 am

Hannibal_King wrote:Hello,

i have a question, why the links in viewonline.php is not rewrited? is it normal? because here it works fine... :(

Edit: and why all robots on my board are still on the index page? :cry: where could be the problem?


ho you want this one as well ?

I am not sure about what Janof said exactly, but I get the point, we disallow viewonline and the provided links so it's not going to hurt.

Then, for the "why", as you must have noticed, these mod rewrite do need some small code changes to inject titles, so this mean by default only the genuine phpBB links are rewritten, but you can add support for any mods.

I know this can seem a bit more work at first if you compare with the ob_start method, but think of it this way, those small required steps are saving large amounts of server resource, which can be crucial.
Here we only tell the php rewrite core to rewrite the link we want while the ob start method will always try to rewrite links, which sometime does not work for all links by default anyway, even though there are no link to rewrite on a page.

So for the viewonline, here is the trick :

Open :

viewonline.php

find :

Code: Select all
      else
      {
         $location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $row['session_page']);


replace with :
Code: Select all
      else
      {
         // www.phpBB-SEO.com SEO TOOLKIT BEGIN
         $seo_forum_name = $forum_data[$row['session_page']];
         // www.phpBB-SEO.com SEO TOOLKIT END
         $location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $row['session_page']);


And it should do it ;)

++
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

PreviousNext

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