Migrating from webmedic to Advanced re-write

Discussions and support about the different URL Rewriting techniques for phpBB2.

Moderator: Moderators

Migrating from webmedic to Advanced re-write

Postby mreider » Wed Nov 01, 2006 9:59 pm

First off, thanks for making a wicked mod. It's great. :lol:

I've been using your version of the webmedic mod, and want to switch it up to the Advanced rewrite.

I've already stripped out the old webmedic code, added the new advanced rewrite code, and I'm basically ready to upload...a few concerns first.

Will the new advanced rewrite output different URLs? I have thousands of pages already indexed and don't want to lose them.

If it does output different url's, is there a relatively easy way to 301 to the new urls?

Also, I use phpbbfetchall to pull thread titles and display them in the non-phpbb sections of my site. Right now it's acheived by using the function:

Code: Select all
<?php echo append_sid(make_url_friendly($recent[$i]['topic_title']) . '-vt' . $recent[$i]['topic_id']); ?>


I know the make_url_friendly functoin is in the old mod - Is there an equivalent in the advanced seo rewrite?

Thanks so much - I'm eager to do this, I've even done your optimize keywords thing (and went through 1000 of the top words on the site and removed a tonne).
mreider
phpBB SEO Team
phpBB SEO Team
 
Posts: 292
Joined: Sun May 07, 2006 3:11 pm

Advertisement

Postby dcz » Thu Nov 02, 2006 9:19 am

In the related link there is this one that should interest you : http://www.phpbb-seo.com/boards/phpbb-m ... vt117.html

And yes, I did keep the possibility to manually build up links the same way we could with webmedic's good old code.

You'll just need to change make_url_friendly() with format_url(), which is doing the same job, only better and faster.

For the eventual differences in URLs, tell me when you're ready, and I'll PM you the zero duplicate ;)

The differences are minor, double hyphens (--) avoided, ' replaced with - and a lot nicer pagination ;)

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

Postby mreider » Thu Nov 02, 2006 3:27 pm

So just to be 100% sure - I won't need any 301's? The url's will stay the same, with the exception of double-hyphen ones?
mreider
phpBB SEO Team
phpBB SEO Team
 
Posts: 292
Joined: Sun May 07, 2006 3:11 pm

Postby dcz » Thu Nov 02, 2006 8:56 pm

You will need the zero duplicate ;)

I PM it to you now ;)

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

Postby mreider » Sun Nov 05, 2006 1:02 am

So I've pretty much got this all working but I'm running into this problem.

After posting a new topic, deleting an old one, etc (posting.php) the link that looks like:
Code: Select all
Your message has been deleted successfully.

Click Here to return to the forum


Has a link like: viewforum.php?f=9

Instead of the correct re-write link, and when you click on the link, it then times out (maybe stuck in some loop).

Any ideas? Otherwise it seems to all be working well..
mreider
phpBB SEO Team
phpBB SEO Team
 
Posts: 292
Joined: Sun May 07, 2006 3:11 pm

Postby dcz » Sun Nov 05, 2006 11:51 am

Well, the fact you see an unrewritten "click here to return to the topic" link after you posted, but it should as it is here, be http 301 redirected by the zero dupe to the rewritten topic URL after you follow it.

Are the other URLs properly redirected ?

Could you post (or pm) a link to you forum so I can check ?

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

Postby mreider » Sun Nov 05, 2006 4:39 pm

Could this code be a problem:
Code: Select all
$seo_forum_name = FALSE;
?

I also notice it does the same thing on the last topic displayed on the main forum index (giving the incorrect re-written link).

Is it possible I missed something with the old keywords-url 2.3.1 mod?

Or this code in posting.php
Code: Select all
   else
   {
      redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
   }
could be the problem?

Here is my .htaccess:
Code: Select all
#########################################################
# forums SEO REWRITE RULES            #
#########################################################
# AUTHOR : DCZ http://www.forums-seo.com
# STARTED : 01/200
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^forums/.+/([^/]+\.html)$ /forums/index.php [R=301,L]
# CATEGORIES
RewriteRule ^forums/.+-vc([0-9]+)\.html$ /forums/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forums/.+-vf([0-9]+)-([0-9]+)\.html$ /forums/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^forums/.+-vf([0-9]+)\.html$ /forums/viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^forums/.+-vt([0-9]+)-([0-9]+)\.html$ /forums/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^forums/.+-vt([0-9]+)\.html$ /forums/viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^forums/post([0-9]+)\.html$ /forums/viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^forums/member([0-9]+)\.html$ /forums/profile.php?mode=viewprofile&u=$1 [QSA,L]
# END forums PAGES


phpbb is in the subfolder 'forums' and the htaccess is in the / root of the site.
mreider
phpBB SEO Team
phpBB SEO Team
 
Posts: 292
Joined: Sun May 07, 2006 3:11 pm

Postby dcz » Mon Nov 06, 2006 10:58 am

Code: Select all
$seo_forum_name = FALSE;


Is meant to initialize the URL rewriting process, so yes, as every piece of code suggested in the mod, it is required.

The last post link is left statically rewritten for now because all post URLs are duplicate and we don't want to keep them.

The good old webmedic's code was injecting titles in some of the post URLs (remember the image-vpxx.html links on index ?) which was making it impossible to properly disallow them in our robots.txt file.

The zero duplicate is taking car of them now, so it's no worry at all to keep them, and your robots.txt could have do this anyway (which was impossible with the webmedic's code).

Next update will allow to totally get rid of post URLs in output, as on this site.

The phpBB SEO mod rewrites are doing exactly what's shown on www.phpbb-seo.net (don't forget you can do some choices).

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

Postby mreider » Mon Nov 06, 2006 5:21 pm

One thing I forgot to mention about the topic on index. I'm using the Last Topic Title on Index mod (you can find it on phpbb.com).

I managed to fix the code to work with the advanced mod re-write. It isn't pretty, but it works.

If you're using the Last Topic Title on Index mod then do the following.

Code: Select all
in index.php find:
$last_post .= $lang_in . '&nbsp;' . '<a title="' . $altlttitle . '" alt="' . $altlttitle . '" href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . $lttitle . '</a><br />';

Replace with:
$last_post .= $lang_in . '&nbsp;' . '<a title="' . $altlttitle . '" alt="' . $altlttitle . '" href="' . append_sid(format_url($lttitle) . '-vt' . $ltid . '.html') . '">' . $lttitle . '</a><br />';


And that'll give you the title of the last posted topic on your index page, re-written using the phpbbseo code.

I'm going to try the same thing on my post re-direct page to see if I can get that working properly too.
mreider
phpBB SEO Team
phpBB SEO Team
 
Posts: 292
Joined: Sun May 07, 2006 3:11 pm

Postby dcz » Mon Nov 06, 2006 5:29 pm

This is correct, but if you really want to fight duplicates, you should pass topic titles through the phpBB censoring system.

The last topic on index mod is pretty similar to the today at/ yesterday at, which was already patched here.

If you want, I can take a look to yours specifically if you send a download link ;)

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

Postby mreider » Mon Nov 06, 2006 5:35 pm

Here's a link to download the last topic on index mod:
http://www.phpbb.com/phpBB/viewtopic.php?t=350442

Thanks for having a look :) Like I said, it seems to be working, but you're right, it should go through the filter system.

I found this in many places in my posting.php, which creates the re-direct links:
Code: Select all
'<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">


I'm thinking I need to do the same thing (format_url) but again should pass things through the filter. How do I get that working? :lol:
mreider
phpBB SEO Team
phpBB SEO Team
 
Posts: 292
Joined: Sun May 07, 2006 3:11 pm

Postby dcz » Mon Nov 06, 2006 5:52 pm

Well, for posting.php, you'll need more than the same trick, as you'll need to grab the topic title.

I'll do this for next update, till then, you should not loose time on this, as no bot will ever see such links (even AdSense as they get redirected before Google can know it).

For the topic on index mod :

Open :

Code: Select all
index.php


Find :

Code: Select all
                        if (!$auth_read_ary[$forum_data[$j]['forum_id']]['auth_read'])
                        {
                           $lttitle = '';
                           $lang_in = '';
                         }

                     // append first 25 characters of topic title to last topic data
                        $lttitle = (strlen($lttitle) > 25) ? substr($lttitle,0,25) . '...' : $lttitle;

                        $last_post .= $lang_in . '&nbsp;' . '<a title="' . $altlttitle . '" alt="' . $altlttitle . '" href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . $lttitle . '</a><br />';


Replace with :

Code: Select all
                        // www.phpBB-SEO.com SEO TOOLKIT BEGIN
                        if ($auth_read_ary[$forum_data[$j]['forum_id']]['auth_read'])
                        {
                           $seo_topic_name = $lttitle;
                           // append first 25 characters of topic title to last topic data
                           $lttitle = (strlen($lttitle) > 25) ? substr($lttitle,0,25) . '...' : $lttitle;

                           $last_post .= $lang_in . '&nbsp;' . '<a title="' . $altlttitle . '" alt="' . $altlttitle . '" href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . $lttitle . '</a><br />';
                            }
                        // www.phpBB-SEO.com SEO TOOLKIT END


And it should be ok ;)

I did so the last topic link will not be shown if the user does not have the right to browse the forum.

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

Postby mreider » Mon Nov 06, 2006 7:08 pm

Fantastic, that works well.

One thought for the phpbbseo site - Maybe you should start a sub-forum with other mods that have been patched to work with your re-write - That'd help a lot of people too!

About the posting.php - The problem right now isn't so much dupe URLs as it is the re-direction. When you click on "Click here to view your message" it hangs and times out when trying to go to the viewforum or viewtopic link. I'm not sure why (which is why I wanted to do the re-writing).
mreider
phpBB SEO Team
phpBB SEO Team
 
Posts: 292
Joined: Sun May 07, 2006 3:11 pm

Postby dcz » Mon Nov 06, 2006 9:21 pm

It should not time out, are you sure the zero dupe is working well ?

Please post a link here so I can check if you like.

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

Postby arch_stanton » Mon Nov 27, 2006 7:02 pm

*edited*
Last edited by arch_stanton on Mon Nov 27, 2006 10:26 pm, edited 1 time in total.
arch_stanton
PR1
PR1
 
Posts: 163
Joined: Wed Oct 04, 2006 9:48 am

Next

Return to phpBB2 mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests