Migrate from able2know to Seo Mixed Mod Rewrite

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

Moderator: Moderators

Migrate from able2know to Seo Mixed Mod Rewrite

Postby varteju » Sat Nov 25, 2006 8:48 pm

Hi, i upgraded my forum from able2know's modrewrite to the mixed mod rewrite and i followed the instruction from http://www.phpbb-seo.com/boards/phpbb-m ... vt303.html

I get couple of errors:
It still shows viewforum.php?f=# (shouldnt this be in html also?) and when i click on a Froum i get:
Fatal error: Call to undefined function: session_pagestart() in /home/public_html/forum/viewforum.php on line 93
which is this line:
$userdata = session_pagestart($user_ip, $forum_id);

Now i was able to click on the forum at the beginning and i didnt get any errors...however i was getting an error when trying to click on a certain topic...Cannot be found type of error...now i can't get past the forum part though!

Help...
varteju
 
Posts: 25
Joined: Sat Nov 25, 2006 4:28 am

Advertisement

Postby varteju » Sat Nov 25, 2006 9:11 pm

ok right now i'm in this situation:
All the modifications made and unmade (from able2know)....htaccess included

Click on forum:
Fatal error: Call to undefined function: if_query() in /home/forum/includes/sessions.php on line 499
...
which is: $urlout = array( "topic\\1-\\2.html".if_query('\\3')."",


If i upload the old sessions.php my forum works in the format:
viewforum.php?f=#
viewtopic.php?t=#

Interesting enough there's no SID's...what am i doing wrong......
varteju
 
Posts: 25
Joined: Sat Nov 25, 2006 4:28 am

Postby dcz » Sat Nov 25, 2006 9:30 pm

Don't worry, it's only a matter of doing everything properly.

A link to your forum would help out to help you out.

Anyway, to migrate from the able2know mod you should follow theses steps :

1) undo all code changes from "phpBB static URLs mod _rewrite 1.0.0.txt",

2) In order to install the cyber alien guest session mod, do the following :

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

includes/sessions.php

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

$SID = 'sid=' . $session_id;

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

if ( $userdata['session_user_id'] != ANONYMOUS ){
   $SID = 'sid=' . $session_id;
} else {
   $SID = '';
}


and install the cyber alien guest sessions mod.

3) update your .htaccess for the phpBB SEO mixed mod rewrite :

Code: Select all
Options +FollowSymlinks
RewriteEngine On
RewriteBase /

#########################################################
# PHPBB SEO REWRITE RULES            #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^forum/.+/([^/]+\.html)$ /forum/index.php [R=301,L]
# CATEGORIES
RewriteRule ^forum/.+-vc([0-9]+)\.html$ /forum/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forum/.+-vf([0-9]+)-([0-9]+)\.html$ /forum/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^forum/.+-vf([0-9]+)\.html$ /forum/viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^forum/topic([0-9]+)-([0-9]+)\.html$ /forum/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^forum/topic([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
#####################################################
# able2know rewriterules
#we keep them to kill them ;-)
RewriteRule ^forum/forums.* /forum/index.php [L,NC]
RewriteRule ^forum/post-([0-9]*).html&highlight=([a-zA-Z0-9]*) /forum/viewtopic.php?p=$1&highlight=$2 [L,NC]
RewriteRule ^forum/post-([0-9]*).* /forum/viewtopic.php?p=$1 [L,NC]
RewriteRule ^forum/view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* /forum/viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^forum/about([0-9]*).html&highlight=([a-zA-Z0-9]*) /forum/viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^forum/about([0-9]*).html&view=newest /forum/viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^forum/about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* /forum/viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^forum/about([0-9]*)-([0-9]*).* /forum/viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^forum/about([0-9]*).* /forum/viewtopic.php?t=$1 [L,NC]
RewriteRule ^forum/about([0-9]*).html /forum/viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^forum/mark-forum([0-9]*).html* /forum/viewforum.php?f=$1&mark=topics [L,NC]
RewriteRule ^forum/updates-topic([0-9]*).html* /forum/viewtopic.php?t=$1&watch=topic [L,NC]
RewriteRule ^forum/stop-updates-topic([0-9]*).html* /forum/viewtopic.php?t=$1&unwatch=topic [L,NC]
RewriteRule ^forum/forum-([0-9]*).html /forum/viewforum.php?f=$1 [L,NC]
RewriteRule ^forum/forum-([0-9]*).* /forum/viewforum.php?f=$1 [L,NC]
RewriteRule ^forum/topic-([0-9]*)-([0-9]*)-([0-9]*).* /forum/viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^forum/ptopic([0-9]*).* /forum/viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^forum/ntopic([0-9]*).* /forum/viewtopic.php?t=$1&view=next [L,NC]


Note that this example is for phpBB installed in a folder called forum/, just change it with the correct one, or delete it if your forum is located at the domain's root level.
This .htaccess should be located at the domain's root, no .htaccess should be kept in the forum folder if any.

You'll may need to get rid of this line :

Code: Select all
Options +FollowSymlinks


or of the slashes ("/") at the beginning of the right part of the rewriterules eg :

Code: Select all
RewriteRule ^forum/.+-vc([0-9]+)\.html$ /forum/index.php?c=$1 [QSA,L]


vs

Code: Select all
RewriteRule ^forum/.+-vc([0-9]+)\.html$ forum/index.php?c=$1 [QSA,L]


Once this is done, the forum should output vanilla URLs, but the old able2know one should still work. As well, you should be able to test a topicxx.html URL.

4) Perform the changes : install the phpBB SEO mixed mod rewrite.
Do it for all files before it will work. The if_query error most likely came from the fact functions.php was not updated.

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, tell me and I'll PM you the zero duplicate code ;)

I advise you to take your time, the best would be if you first test the procedure before you go online to make the url switch as fast as possible.
No worries, but you don't want a small typo to mess up for too long.

++
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 varteju » Sat Nov 25, 2006 9:59 pm

OK thank you... http://www.stiintacraiova.com/forum

I seem to have followed all the instructions you listed. Now as you can tell...everything's going great except for the ... mod rewrite :)

I have a .htaccess at the forum level...that's where i added the able2know's code and it worked...i don't see why it wouldn't work the same for this mod. I do see one on the domain level and it only has 3 lines in it...

I have the simple sub forum hack installed and i applied the modifications listed in another topic (http://www.phpbb-seo.com/boards/phpbb-m ... -vt41.html)

Should i start it over and pay close attention this time since i do have to uninstall a hack, then add 2 others...so like you said, any small mistake = big mistake in the end...

PS: so what changes should i make on the .htaccess file. As you can see my forum is installed under /forum! Should i get rid of the first line or get rid of all the extra "/" before forum?
varteju
 
Posts: 25
Joined: Sat Nov 25, 2006 4:28 am

Postby dcz » Sat Nov 25, 2006 10:07 pm

Well,, for the reason why I set the priority to install the rewriterules in the root's .htaccess is because this is a lot easier to create rules that will work for all folders, like the www prefix redirection.

So the rewriterules are meant to be there. As you can see -http://www.stiintacraiova.com/forum/topic2122.html is not working and it should as soon as the .htaccess will be installed properly.
Same for -http://www.stiintacraiova.com/forum/about2122.html

Then, the link should be outputted rewritten if you performed all the code changes.

This type of links suggest you did not upload most part of the code changes : viewtopic.php?t=2122&start=0&postdays=0&postorder=asc&highlight=
Make sure you perform change in all required file following the mixed mod's install.

++
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 varteju » Sat Nov 25, 2006 10:42 pm

OOo ok...as soon as i got rid of the htaccess file from the forum level and put the code in the root level it worked. I get the topic#.htmls working now...no sign of about1221.html though

The only changes i made to viewforum.php are

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

viewforum.php

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

if( $all_forums[$i]['forum_id'] == $parent_id )
{

#
#-----[ AFTER, ADD ]------------------------------------------
#

// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $all_forums[$i]['forum_name'];
// phpBB-SEO.com SEO TOOLKIT END

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

if( $total_forums )
{

#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $forum_row['forum_name'];
// phpBB-SEO.com SEO TOOLKIT END


#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('catrow.forumrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,

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

// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $subforum_data[$j]['forum_name'];
// phpBB-SEO.com SEO TOOLKIT END


And another question :oops: ... is this mod supposed to turn the topic urls into the topics' titles? Or would that be the advanced mod (if so, how can i update to it). And how would that work? Would i have to personally select the keywords to show up in the urls or can i just make it so when someone starts a new thread, the title will automatically appear in the url?

Thank you!
varteju
 
Posts: 25
Joined: Sat Nov 25, 2006 4:28 am

Postby dcz » Sun Nov 26, 2006 10:58 am

Well, you need to calm down a bit and take your time to properly choose what you want before proceeding.

You don't want to change URLs every other day.

The thread to go for the advanced mod rewrite is here.

But please make up your mind first.

For your other question, being a bit off topic where it stands, you need to implement the mx Google sitemaps rewriterules at the end of the phpBB SEO one (eg before the able2know one).


So far the old and new url are working http://www.stiintacraiova.com/forum/about2122.html http://stiintacraiova.com/forum/topic1868.html
But you still need to install the mod fully. I see here : -http://stiintacraiova.com/forum/viewforum.php?f=10 that you probably made the changes for sessions.php and viewforum.php, but not fully for viewtopic nor for the index (and maybe you miss some change in functions.php).

The code changes are few, you first task after you'll make up your mind about what URL standard you would like, will be to fully install the selected phpBB SEO mod rewrite.

Once this is done, I'll pm you the zero dupe.

++
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 varteju » Sun Nov 26, 2006 2:02 pm

Ah ok...well right now i'm trying to install the mixed SEO mod correctly and then update if i decide to.

I think i got it now but i'm not sure...i no longer get the viewforum.php?f=# but i actually get the forum's name in there.
So...c'est fini with that mod? :)

As for the sitemap mod...i did add
"RewriteRule ^sitemaps.xml$ /sitemap.php [L]
RewriteRule ^forum-sitemap-([0-9]+).xml$ /sitemap.php?fid=$1 [L]
RewriteRule ^sitemap-forum.xml$ /sitemap.php?forum [L]"
at the end of my .htaccess file but when i go here for example http://stiintacraiova.com/forum/forum-sitemap-40.xml it says the forum doesn't exist.

(Now i moved it in at the root level...hence it's www.stiintacraiova.com/sitemap.php - still same error)

I'm sorry i have so many questions
varteju
 
Posts: 25
Joined: Sat Nov 25, 2006 4:28 am

Postby dcz » Sun Nov 26, 2006 2:35 pm

dcz wrote:For your other question, being a bit off topic where it stands, you need to implement the mx Google sitemaps rewriterules at the end of the phpBB SEO one (eg before the able2know one).

So you'll really need to do this, because the old able2know rewriterules should be at the very bottom of the .htaccess (they do too redirect "forum" so the order matters).

You still miss one code change in viewforum.php to have the current forum link rewritten.

And I saw some special characters not being properly filtered.
Example : -http://stiintacraiova.com/forum/juc-258-torii-vf3.html

It seem the Ă and ă characters is not properly handled.

To fix this, open :

Code: Select all
includes/functions.php


Find :

Code: Select all
   $url = str_replace (array('ü','Ü'), 'ue', $url);


After add :
Code: Select all
   $url = str_replace (array('ă','Ă'), 'a', $url);


Note that you may have to enter the HTML ASCII code for these chars eg : "& # 259;" and "& # 258;" (without the spaces).

I PM you the zero dupe ;)

++
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 varteju » Sun Nov 26, 2006 2:45 pm

Thank you for all your help...but i still have the same problem with the forum-sitemap-63.xml that says the forum doesn't exist.
This is my .htaccess file if it helps you help me in any way

Options +Indexes
IndexOptions -FancyIndexing
suPHP_ConfigPath /home/username/public_html
Options +FollowSymlinks
RewriteEngine On
RewriteBase /

#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^forum/.+/([^/]+\.html)$ /forum/index.php [R=301,L]
# CATEGORIES
RewriteRule ^forum/.+-vc([0-9]+)\.html$ /forum/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forum/.+-vf([0-9]+)-([0-9]+)\.html$ /forum/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^forum/.+-vf([0-9]+)\.html$ /forum/viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^forum/topic([0-9]+)-([0-9]+)\.html$ /forum/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^forum/topic([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
#####################################################
# able2know rewriterules
#we keep them to kill them ;-)
RewriteRule ^forum/forums.* /forum/index.php [L,NC]
RewriteRule ^forum/post-([0-9]*).html&highlight=([a-zA-Z0-9]*) /forum/viewtopic.php?p=$1&highlight=$2 [L,NC]
RewriteRule ^forum/post-([0-9]*).* /forum/viewtopic.php?p=$1 [L,NC]
RewriteRule ^forum/view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* /forum/viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^forum/about([0-9]*).html&highlight=([a-zA-Z0-9]*) /forum/viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^forum/about([0-9]*).html&view=newest /forum/viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^forum/about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* /forum/viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^forum/about([0-9]*)-([0-9]*).* /forum/viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^forum/about([0-9]*).* /forum/viewtopic.php?t=$1 [L,NC]
RewriteRule ^forum/about([0-9]*).html /forum/viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^forum/mark-forum([0-9]*).html* /forum/viewforum.php?f=$1&mark=topics [L,NC]
RewriteRule ^forum/updates-topic([0-9]*).html* /forum/viewtopic.php?t=$1&watch=topic [L,NC]
RewriteRule ^forum/stop-updates-topic([0-9]*).html* /forum/viewtopic.php?t=$1&unwatch=topic [L,NC]
RewriteRule ^forum/forum-([0-9]*).html /forum/viewforum.php?f=$1 [L,NC]
RewriteRule ^forum/forum-([0-9]*).* /forum/viewforum.php?f=$1 [L,NC]
RewriteRule ^forum/topic-([0-9]*)-([0-9]*)-([0-9]*).* /forum/viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^forum/ptopic([0-9]*).* /forum/viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^forum/ntopic([0-9]*).* /forum/viewtopic.php?t=$1&view=next [L,NC]

#########################################################
# MX GG_SITEMAPS REWRITE RULES #
#########################################################
# AUTHOR : dcz http://www.phpbb-seo.com/
# STARTED : 2006/02/22
########################
########################################################
# phpBB
RewriteRule ^sitemaps.xml$ /sitemap.php [L]
RewriteRule ^forum-sitemap-([0-9]+).xml$ /sitemap.php?fid=$1 [L]
RewriteRule ^sitemap-forum.xml$ /sitemap.php?forum [L]


Should i just stick with the inital output (/forum/sitemap.php?fid=2)?

I think i found and made the missing change to viewforum.php.

Now i'll install the zero (thank you for it) and follow the thread you gave me in order to upgrade to the advanced seo.
varteju
 
Posts: 25
Joined: Sat Nov 25, 2006 4:28 am

Postby dcz » Sun Nov 26, 2006 3:04 pm

dcz wrote:
dcz wrote:... you need to implement the mx Google sitemaps rewriterules at the end of the phpBB SEO one (eg before the able2know one).


Put :

Code: Select all
# phpBB
RewriteRule ^sitemaps.xml$ /sitemap.php [L]
RewriteRule ^forum-sitemap-([0-9]+).xml$ /sitemap.php?fid=$1 [L]
RewriteRule ^sitemap-forum.xml$ /sitemap.php?forum [L]


before :

Code: Select all
# able2know rewriterules


in your .htaccess ;)

++
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 varteju » Sun Nov 26, 2006 3:08 pm

# END PHPBB PAGES
#####################################################
# phpBB
RewriteRule ^sitemaps.xml$ /sitemap.php [L]
RewriteRule ^forum-sitemap-([0-9]+).xml$ /sitemap.php?fid=$1 [L]
RewriteRule ^sitemap-forum.xml$ /sitemap.php?forum [L]
# able2know rewriterules
#we keep them to kill them ;-)


Same caca ... google bot does read the last one though with the 'site' -> url_list.txt but not the .xml ones....
varteju
 
Posts: 25
Joined: Sat Nov 25, 2006 4:28 am

Postby dcz » Sun Nov 26, 2006 3:16 pm

Ho, I see, it is actually working, but you did not properly edit the sitemap.php file while moving it to root : http://stiintacraiova.com/forum-sitemap-40.xml is the correct URL.

http://www.phpbb-seo.com/boards/phpbb-s ... .html#3187

;)

++
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 varteju » Sun Nov 26, 2006 6:24 pm

Mhm...i had those changes made from the beginning!
Line 49 - added forum/
Line 72 - added //

So the sitemap.php is right...what else could output that extra /forum/ ?

I upgraded to the advanced mod and it seems to be working!!! I didn't even have to ask you for help, are you proud of me? :roll:
I was getting some errors but it was because i had installed the first zero dupe not the second one.

So if you could please help me with the sitemap, then everything would be complete and working! Should i install the mx sitemaps mod as well?
varteju
 
Posts: 25
Joined: Sat Nov 25, 2006 4:28 am

Postby dcz » Sun Nov 26, 2006 10:22 pm

You're doing too many things at a time.

So now you need to upload the premodded sitemap_forum.php for the advanced mod rewrite.

For you extra forum/ path, please double check you performed the correct changes in your sitemap.php, the one at the domain root (should be the only one as well).

If not enough, check if you did not put stiintacraiova.com/forum as domain name in phpBB config (should be stiintacraiova.com) but I doubt it.

It should be working.

++
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

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