help converting from old Mod Rewrite to Advanced mod Rewrite

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

help converting from old Mod Rewrite to Advanced mod Rewrite

Postby spy » Thu Mar 08, 2007 12:09 am

Hello,

I have Arabic phpBB forum , working on heavy modded version based on phpBB 2.0.22

http://www.3arabsoft.com/forum/

I'm using very old mod rewrite which deleted from phpbbhacks database because its developer stopped supporting it :lol:
http://www.phpbbhacks.com/download/4702

anyways this mod have many problems (like duplicate content)
and causing high server load

is there any way for converting it into Advanced mod Rewrite without losing pages ranking popularity?

thanks in advance :)
spy
 
Posts: 38
Joined: Wed Mar 07, 2007 10:34 pm

Advertisement

Postby dcz » Thu Mar 08, 2007 2:18 pm

And welcome :D

So yes, there is.

The steps are not difficult, but should be performed with caution, as we want everything to work on the first try to make the url switching as sudden as possible for SEs to handle it as fast as possible.

As you can see from this report, when everything is done cautiously, migrating is really fast and does not even cause any loss of visitors from SEs.

There is as well something to take care well about in your case, it's the windows-1256 you're using. We already have a solution for UTF-8, that makes the mod only inject the latin1 charset word in urls : http://forum.persia-cms.com/

As you can see this UTF-8 version is able to only inject Latin characters in urls and to rather use a static rewriting when no Latin characters are found in the title.

This is done by only replacing the format_url code in phpbb_seo/phpbb_seo_class.php, the code used for utf-8 is the following :

Code: Select all
function format_url( $url, $type = 'topic' ) { // The UTF-8 0.2.x candidate :-)
         //Short url
         $url = preg_replace("(\[.*\])U","",$url);
         $url = strtolower($url);
         $find = array('"','&','<','>','\r\n','\n',);
         $url = str_replace ($find, '-', $url);
         $url = rawurlencode($url);
         $url = preg_replace("`%[a-zA-Z0-9]{2}`", "-", $url);
         $url = preg_replace("`[^a-zA-Z0-9-]`", "-", $url);
         $url = preg_replace("`([\-])+`", "\\1", $url);
         $url = trim($url, '-');
         $url = ( $url == "" ) ? $type : $url;
         return $url;
   }


It should as well work for windows-1256, but this need to be confirmed.

So the best would be if you set up a test forum, live or local to make sure everything is installed properly and as well the windows-1256 handling before you go online.

On the test forum, follow these steps :

1) undo all code changes from the mod_rewrite Keyword URLs mod you're using.

2) Make sure the cyber alien guest session mod is installed, it seems it is.

3)
update your .htaccess for the phpBB SEO advanced mod rewrite. I could not download your mod, but the principle is you want both types of url to work, to be able to redirect them.
According to what I see on your forum, the two standard are close, yours using -vt and -vf (like the good old webmedic mod used to) so the following .htaccess should do it at the domains' root level (not in the forum/ folder) :

Code: Select all
RewriteEngine On
RewriteBase /

#########################################################
# PHPBB SEO REWRITE RULES            #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM INDEX (un-comment if used)
# RewriteRule ^forum/index\.html$ /forum/index.php [QSA,L]
# FORUM PROTECTION RULE
# RewriteRule ^forum/.*/([^/]+\.html)$ /forum/index.php [R=301,L]
# CATEGORIES
RewriteRule ^forum/.*-v?c([0-9]+)\.html$ /forum/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forum/.*-v?f([0-9]+)-([0-9]+)\.html$ /forum/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^forum/.*-v?f([0-9]+)\.html$ /forum/viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^forum/.*-v?t([0-9]+)-([0-9]+)\.html$ /forum/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^forum/.*-v?t([0-9]+)\.html$ /forum/viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^forum/post([0-9]+)\.html$ /forum/viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^forum/member([0-9]+)\.html$ /forum/profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES
#####################################################


Which is just the regular phpBB SEO advanced mod rewrite .htaccess, for folder installs, I just replaced all the phpbb with forum to suite your set up and added "v?" in the rewriterule to extend the redirect to both -f and -vf.

The zero duplicate will do the proper redirect, but will install it a little after.

At this stage you should see the phpbb vanilla URL outputted on the forum and still have the rewritten links working. You can test the .htaccess live as well, links should work exactly as now on the live forum (still using the older mod).

4) Perform the changes : install the phpBB SEO advanced mod rewrite.
Do it for all files before it will work.

Once this is done you should see every link rewritten, unless you're for example using simple sub forum, which will require a small patch.

5) Once all is correct, you can install the advanced zero duplicate.
You can make sure about the headers before you install it if you really want to be able to changes your URL all the sudden, you'll find how on this topic.

Once everything is working nicely on the test forum, first upload the new .htaccess on the live site, links should still work, then upload all changed files and voila ;)
You'll just need to once more make sure about the headers on the live site with the real code and you'll be done.

All other phpBB SEO mods will follow the exact same URL standard as the one decided by the custom format_url.

++
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 spy » Sun Mar 11, 2007 4:45 pm

thanks dcz .. please check your PM
spy
 
Posts: 38
Joined: Wed Mar 07, 2007 10:34 pm

Re: help converting from old Mod Rewrite to Advanced mod Rew

Postby mhmdkhamis » Sun Mar 11, 2007 11:08 pm

spy wrote:Hello,

I have Arabic phpBB forum , working on heavy modded version based on phpBB 2.0.22

http://www.3arabsoft.com/forum/

I'm using very old mod rewrite which deleted from phpbbhacks database because its developer stopped supporting it :lol:
http://www.phpbbhacks.com/download/4702

anyways this mod have many problems (like duplicate content)
and causing high server load

is there any way for converting it into Advanced mod Rewrite without losing pages ranking popularity?

thanks in advance :)


welcome another arabic forum in phpbbseo :D
mhmdkhamis
PR4
PR4
 
Posts: 437
Joined: Sun Nov 26, 2006 11:15 pm
Location: egypt

Postby spy » Sun Mar 11, 2007 11:35 pm

nice to meet you mohamed , not only Arabic but also I'm from Egy/Alex and I think you too :P
spy
 
Posts: 38
Joined: Wed Mar 07, 2007 10:34 pm

Postby mhmdkhamis » Mon Mar 12, 2007 1:31 am

spy wrote:nice to meet you mohamed , not only Arabic but also I'm from Egy/Alex and I think you too :P


yes u are right - welcome spy

sorry dcz i speak out of topic :oops:
mhmdkhamis
PR4
PR4
 
Posts: 437
Joined: Sun Nov 26, 2006 11:15 pm
Location: egypt

Postby dcz » Mon Mar 12, 2007 2:28 pm

spy wrote:thanks dcz .. please check your PM


I did, but I'm not sure about what do you want, what in my suggestion causes you trouble ?

I think you should first work on setting up a test forum with your online script, and once this is done, everything is really easy, try to apply my advises, and tell me exactly where you get stuck ;)

++
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 spy » Tue Mar 13, 2007 1:26 pm

Hello dcz,

I uninstalled the old mod and tried to install yours after installing cyber alien guest session mod

but I cant find any of this codes in index.php

Code: Select all
      if (isset($display_categories[$cat_id]) && $display_categories[$cat_id])
      {

or
Code: Select all
                  if ( $is_auth_ary[$forum_id]['auth_view'] )
                  {

I sent copy of my index file in my last PM

when I try to access any forum I get error:
Fatal error: Call to a member function on a non-object in /home/arabsoft/public_html/test/viewforum.php on line 233 (line which contains your mod rewrite code)

also when I try to access any topic I get error:
Fatal error: Call to a member function on a non-object in /home/arabsoft/public_html/test/viewtopic.php on line 293 (line which contains your mod rewrite code)

I sent copy of my index,viewtopic and viewforum files in my last PM

I dont know whats wrong but my froum using alot of hacks which editing this files

thanks in advance
spy
 
Posts: 38
Joined: Wed Mar 07, 2007 10:34 pm

Postby HB » Tue Mar 13, 2007 3:48 pm

Sorry, I'm coming late into this discussion...
spy wrote:when I try to access any forum I get error:
Fatal error: Call to a member function on a non-object in /home/arabsoft/public_html/test/viewforum.php on line 233 (line which contains your mod rewrite code)

Typically that's because the global $phpbb_seo isn't initialized. It's set in common.php, did you follow these steps?

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

copy phpbb_seo/*.* to phpbb_seo/*.*

#
#-----[ OPEN ]------------------------------------------
#

common.php

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

if (file_exists('install') || file_exists('contrib'))
{
   message_die(GENERAL_MESSAGE, 'Please_remove_install_contrib');
}

#
#-----[ BEFORE, ADD ]------------------------------------------
#

// www.phpBB-SEO.com SEO TOOLKIT BEGIN
include($phpbb_root_path . 'phpbb_seo/phpbb_seo_class.'.$phpEx);
$phpbb_seo = new phpbb_seo();
// www.phpBB-SEO.com SEO TOOLKIT END


dcz wrote:I think you should first work on setting up a test forum with your online script, and once this is done, everything is really easy, try to apply my advises, and tell me exactly where you get stuck ;)

Or install it in an unmodified phpBB 2.0.22 install. I have a "mod free" version of my board ready at all times, with only overall_header.tpl and overall_footer.tpl updates. It saves sanity checks when things don't work. And in the remote chance that I screw up the live board, I can switch simply by renaming the directories. That's saved me a few sleepless nights ("Oh well, I'll figure it out in the morning...").

You don't want to be testing mods on a live board. Install them in a mirror first, then upload to the live board. You'll save lots of hairpulling.
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1220
Joined: Mon Oct 16, 2006 2:25 am

Postby spy » Tue Mar 13, 2007 4:09 pm

Hello HB,

yes Of course I followed this steps and all steps except index.php cause I didnt find the codes

any help?
spy
 
Posts: 38
Joined: Wed Mar 07, 2007 10:34 pm

Postby HB » Tue Mar 13, 2007 4:15 pm

spy wrote:I dont know whats wrong but my froum using alot of hacks which editing this files

spy wrote:any help?

As I suggested before, try installing on a less modified (or unmodified) version of phpBB and hopefully you'll discover where you made a mistake. I cannot divine why EzMOD fails to find base phpBB code in your heavily modified index.php, other than to state the obvious "you must have changed something." :roll:
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1220
Joined: Mon Oct 16, 2006 2:25 am

Postby dcz » Wed Mar 14, 2007 9:25 am

The code you do not find on your index.php usually means you need to update phpBB to last version.

But in your case, it's even more complicated, you're using :

Code: Select all
mod : categories hierarchy


And this one is almost not a mod any more, it's more a phpBB fork now, and unfortunately, we do not have ant ready solution for CH 2.16.

Some user managed to install the simple mod rewrite with it, it's not too much work, but again, there is no official mod yet. It's planned though, so ...

++
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 spy » Wed Mar 14, 2007 11:08 am

Hello

would removing CH help solving my problems?
spy
 
Posts: 38
Joined: Wed Mar 07, 2007 10:34 pm

Postby dcz » Wed Mar 14, 2007 1:17 pm

Well, it would allow you to install any of our phpBB mods without problems.

But this is up to you to knwo how much is CH useful. Personally, I don't think it's required unless you want to run more than one level of sub-forums.

But sub forums is not the only thing CH does, you'll loose some cosmetic features as well.

Something to think about before deciding yourself. But yes, if you uninstall it, you'll be able to install our mods right know, if not, as said we will one day make a mod for CH, most likely ;)

++
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 spy » Wed Mar 21, 2007 11:32 pm

back again :?

I tried to uninstall CH and I faild , its HUGE mod, editing +70 files!!

and yes you are right
But sub forums is not the only thing CH does, you'll loose some cosmetic features as well.


really I'm in need to remove old Mod Rewrite and install Mixed version, any body can help me doing that?
dcz, can you accept my deal?
spy
 
Posts: 38
Joined: Wed Mar 07, 2007 10: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 7 guests