Changed URL's with PHPBB3?

phpBB SEO Premod for phpBB3 support forum.
This premodded version of phpBB3 includes the three different type of URL rewriting for phpBB3 by phpBB SEO. It comes with several other Search Engine Optimization mods installed.

Moderator: Moderators

Changed URL's with PHPBB3?

Postby AMH » Sat Apr 05, 2008 4:37 pm

I have used Version PHPBB2 for many years with PHPBB SEO. Then when I upgraded I now converted the database and gt it up and running. Problem is that all the URL's in Google are now wrong:

In Google:

files-vf9.html (and also) -vt24.html


In Website

files-f9.html (and also) -t24.html




How do I fix this in the HTACCESS?


# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>

# You may need to un-comment the following line
# Options +FollowSymlinks
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
RewriteEngine On
# REWRITE BASE
RewriteBase /forum/
# HERE IS A GOOD PLACE TO ADD THE WWW PREFIXE REDIRECTION

#####################################################
# PHPBB SEO REWRITE RULES - ADVANCED
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. 'forum' REQUIRES TO BE SET AS FORUM INDEX
# RewriteRule ^forum\.html$ index.php [QSA,L,NC]
# FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)(-([0-9]+))?\.html$ viewforum.php?f=$1&start=$3 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER
RewriteRule ^[a-z0-9_-]*-f([0-9]+)/[a-z0-9_-]*-vt([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?f=$1&t=$2&start=$4 [QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
RewriteRule ^announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?t=$1&start=$3 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM
RewriteRule ^[a-z0-9_-]*/?[a-z0-9_-]*-vt([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?t=$1&start=$3 [QSA,L,NC]
# PROFILES ADVANCED
RewriteRule ^[a-z0-9_-]*-u([0-9]+)\.html$ memberlist.php?mode=viewprofile&u=$1 [QSA,L,NC]
# USER MESSAGES ADVANCED
RewriteRule ^[a-z0-9_-]*-m([0-9]+)(-([0-9]+))?\.html$ search.php?author_id=$1&sr=posts&start=$3 [QSA,L,NC]
# GROUPS ADVANCED
RewriteRule ^[a-z0-9_-]*-g([0-9]+)(-([0-9]+))?\.html$ memberlist.php?mode=group&g=$1&start=$3 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ viewtopic.php?p=$1 [QSA,L,NC]
# THE TEAM
RewriteRule ^the-team\.html$ memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES
RewriteRule ^sitemap.xml$ sitemap.php [L]
RewriteRule ^forum-([0-9]+).xml$ sitemap.php?fid=$1 [L]

# FORUM WITHOUT ID & DELIM
# THESE FOUR LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^[a-z0-9_-]+(-([0-9]+))?\.html$ viewforum.php?start=$2 [QSA,L,NC]
# END PHPBB PAGES
#####################################################
AMH
 
Posts: 32
Joined: Wed Oct 11, 2006 8:45 am

Advertisement

Postby doudou » Sat Apr 05, 2008 9:59 pm

Hi, my english is very bad but open file phpbb_seo/phpbb_seo_class.php

Find and replace

Code: Select all
      // can be edited, requires .htaccess update.
      $this->seo_delim = array( 'forum' => '-f', 'topic' => '-t', 'user' => '-u', 'usermsg' => '-m', 'group' => '-g', 'start' => '-');
      


with this:

Code: Select all
      // can be edited, requires .htaccess update.
      $this->seo_delim = array( 'forum' => '-vf', 'topic' => '-vt', 'user' => '-u', 'usermsg' => '-m', 'group' => '-g', 'start' => '-');
      


You must do a copie of this file before any modifications.
doudou
phpBB SEO Team
phpBB SEO Team
 
Posts: 340
Joined: Sun Sep 17, 2006 6:26 pm
Location: Dans son Coeur...

Postby AMH » Sun Apr 06, 2008 7:26 am

Image

Thankyou!


-vt ----> OK!

-vf ----> No


Any ideas as I cleared the cache!
AMH
 
Posts: 32
Joined: Wed Oct 11, 2006 8:45 am

Postby janmyszkier » Sun Apr 06, 2008 10:02 am

well as far as I understand vf come from ViewForum and vt comes from ViewTopic, so why one is better than other in your opinion?
janmyszkier
PR0
PR0
 
Posts: 50
Joined: Fri Oct 12, 2007 11:47 pm
Location: Wroclaw, Poland.

Postby doudou » Sun Apr 06, 2008 5:53 pm

AMH wrote:Image

Thankyou!


-vt ----> OK!

-vf ----> No


Any ideas as I cleared the cache!

vt ok ? oki my englesh :?

but for vf, the blem is your htaccess. If you choise an virtual folders of your url rewriting in admin panel, you have www.monsite.com/folders-of-forum/forum- ... c-txx.html
there are not working the changing -f to -vf.

One solution is: you desactiving the use of virtual folders in admin panel.

Image
doudou
phpBB SEO Team
phpBB SEO Team
 
Posts: 340
Joined: Sun Sep 17, 2006 6:26 pm
Location: Dans son Coeur...

Postby SeO » Tue Apr 08, 2008 9:39 am

Simpler solution, keep everything as it was at first, eg keep using the -t and -f, and to catch the -vf and -vt's, just replace all occurrences of -f and -t with -v?f and -v?t in your .htaccess.

The zero duplicate will do the rest and you'll be able to keep the virtual folder trick on ;)
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm


Return to phpBB SEO Premod

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Bing [Bot] and 5 guests