renaming "/phpBB2/" into "myforum"

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

Moderator: Moderators

renaming "/phpBB2/" into "myforum"

Postby alexzive » Sun Jan 21, 2007 6:20 pm

hello again:)

Q: is it better to rename the folder "phpBB2" into "myforum" to get a better indicization for the search engines like google?

thanks, Alex
alexzive
 
Posts: 7
Joined: Sun Jan 21, 2007 2:50 pm

Advertisement

Postby dcz » Sun Jan 21, 2007 6:47 pm

Yes, using phpBB/ as install folder name is not the best thing to do.
You'd better use this folder name to add a better keyword.

forum/ is not always good, lots of time it is possible to find a word, handy and useful for both users and SEO.

Then, this is for when you first install your forum.

If your forum was first installed online in a folder named phpBB/, you can change it, but you'll have to HTTP 301 redirect all links. As this mean all your forums url are going to change.

It's not hard to do, it's just something you'd better be sure about before implementing it. You do not want to change URL every other day.

To do it, you'd just need to add this rewriterule before the forum ones :
Code: Select all
rewriteRule ^old_folder/(.*)$ /new_folder/$1 [QSA, L, R=301]


And update phpBB config with the new folder name, as well as, obviously rename the actual install folder used for phpBB ;)

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

Postby alexzive » Sun Jan 21, 2007 7:12 pm

thank you very much.

1)
Code: Select all
rewriteRule ^old_folder/(.*)$ /new_folder/$1 [QSA, L, R=301]


do you mean to just add this line in the ".htaccess" just before
Code: Select all
# FORUM PROTECTION RULE
RewriteRule ^phpBB2/.+/([^/]+\.html)$ /phpBB2/index.php [R=301,L]

???

2) I found in my local support for phpbb2 that I should also upgrade the db like this:

Code: Select all
UPDATE phpbb_config SET config_value = 'www.mydomain.com' WHERE config_name = 'cookie_domain';
UPDATE phpbb_config SET config_value = '/myforum/' WHERE config_name = 'cookie_path';
UPDATE phpbb_config SET config_value = 'www.mydomain.com' WHERE config_name = 'server_name';
UPDATE phpbb_config SET config_value = '/myforum/' WHERE config_name = 'script_path';


should I?
Last edited by alexzive on Sun Jan 21, 2007 7:13 pm, edited 1 time in total.
alexzive
 
Posts: 7
Joined: Sun Jan 21, 2007 2:50 pm

Postby dcz » Sun Jan 21, 2007 7:13 pm

Yes for the rewriterule and for the db editing, you can just go to acp and do it from there, just update script path ;)

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

Postby alexzive » Sun Jan 21, 2007 7:19 pm

many thanks,

a last question:
my forum is named "progressforum" and is about science and technology.
Do you mean renaming ["phpBB2"-->"science"] could positively affect a google search like:

"science" + "topic keyword"

??
Last edited by alexzive on Sun Jan 21, 2007 7:21 pm, edited 1 time in total.
alexzive
 
Posts: 7
Joined: Sun Jan 21, 2007 2:50 pm

Postby dcz » Sun Jan 21, 2007 7:19 pm

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

Postby alexzive » Sun Jan 21, 2007 7:23 pm

great! :)
thks again!
alexzive
 
Posts: 7
Joined: Sun Jan 21, 2007 2:50 pm

Postby hvactechforum » Sat Mar 03, 2007 6:28 am

I would really like more information on this subject if possible. There are a couple of things that I do not understand. Let me explain...

Here is the example database modification that you show (below). Are these queries that I would run in phpmyadmin? Also, I don't know how to fill in the fields.

Code: Select all
UPDATE phpbb_config SET config_value = 'www.mydomain.com' WHERE config_name = 'cookie_domain';
UPDATE phpbb_config SET config_value = '/myforum/' WHERE config_name = 'cookie_path';
UPDATE phpbb_config SET config_value = 'www.mydomain.com' WHERE config_name = 'server_name';
UPDATE phpbb_config SET config_value = '/myforum/' WHERE config_name = 'script_path';


1. Would I add "http://www.myrealdomain.com" or would I add "www.myrealdomain.com"?

2. What do I put in for cookie_domain?

3. What do I put in for cookie_path?

4. What do I put in for server_name?

5. What do I put in for script_path?

I guess maybe an example would be really, really helpful.

BTW, thanks for all of your hard work. It takes a lot of dedication to create a work like this. ;)
hvactechforum
 
Posts: 44
Joined: Sat Mar 03, 2007 12:50 am

Postby dcz » Sat Mar 03, 2007 2:19 pm

dcz wrote:...for the db editing, you can just go to acp and do it from there, just update script path ;)

++


You can changes these settings in phpbb's acp. it's easier ;)
Code: Select all
acp => configuration.


Then about the proper settings, when renaming phpBB's folder, you should only update the script_path to match the new folder name.

I take this as a occasion to recall the cookie_domain most flexible setting is : .example.com (with the dot "." and you real domain ;)).

You can set it up to many more values, but this one will allow sessions sharing across sub domains (from the same main domain where phpBB is installed) and even though it's not always needed, it can save time to always use this setting in all case.

Server name should be set to www.example.com in case you're using the www prefix or example.com when you do not.

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

Postby hvactechforum » Sat Mar 03, 2007 6:09 pm

Thanks dcz 8)
hvactechforum
 
Posts: 44
Joined: Sat Mar 03, 2007 12:50 am

Postby euroman » Sun Mar 04, 2007 1:47 am

dcz wrote:Yes, using phpBB/ as install folder name is not the best thing to do.
You'd better use this folder name to add a better keyword.

forum/ is not always good, lots of time it is possible to find a word, handy and useful for both users and SEO.

Then, this is for when you first install your forum.

If your forum was first installed online in a folder named phpBB/, you can change it, but you'll have to HTTP 301 redirect all links. As this mean all your forums url are going to change.

It's not hard to do, it's just something you'd better be sure about before implementing it. You do not want to change URL every other day.

To do it, you'd just need to add this rewriterule before the forum ones :
Code: Select all
rewriteRule ^old_folder/(.*)$ /new_folder/$1 [QSA, L, R=301]


And update phpBB config with the new folder name, as well as, obviously rename the actual install folder used for phpBB ;)

++


rewriteRule ^old_folder/(.*)$ /new_folder/$1 [QSA, L, R=301]

I am moving from root to new_folder

so I should add: rewriteRule ^/(.*)$ /new_folder/$1 [QSA, L, R=301]

? Well, it dosent work.

Whereas config.php - I cant see there are any folder information in there ?

<?php

// phpBB 2.x auto-generated config file
// Do not change anything in this file!

$dbms = 'mysql4';

$dbhost = 'localhost';
$dbname = 'xxxx';
$dbuser = 'xxx';
$dbpasswd = 'xxxx';

$table_prefix = 'xxxxx';

define('PHPBB_INSTALLED', true);

?>
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm

Postby dcz » Sun Mar 04, 2007 5:46 pm

Well, moving from root to a sub folder is not the same as moving from a folder to another one.

Here we cannot redirect everything, as it would not allow the use of the root level for other pages.

If, as suggested, you implemented the phpBB SEO rewriterules in your root's .htaccess, you can add the following rewriterule at the end of it (here order is important) :

Code: Select all
RewriteRule ^(.*)(-c|-f|-t)([0-9]+)\.html$ http://www.example.com/phpbb/$1$2$3.html [QSA,L,R=301]


Where you need to replace -http://www.example.com/phpbb/ with your real phpBB url.

As well, note that I used the 0.2.x delimiters, you'd need to use (-vc|-vf|-vt) instead of (-c|-f|-t) in case you're using the previous ones.

This rewriterule will redirect categories, forums and topic urls.

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

Postby euroman » Mon Mar 05, 2007 1:45 pm

Strange - I cant make it work:

I put the new .htacess at the real root - not the new phpbb folder.
I put the extra rewrite rule at the bottom of the new .htaccess - also I have chenged it to http://mydomain.com/newfolder/
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm

Postby dcz » Mon Mar 05, 2007 2:11 pm

Well, as is, the redirection will only redirect categories, forum and topic urls, so if you try something else, it won't.

Post here your full .htaccess in case you need more help ;)

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

Postby euroman » Mon Mar 05, 2007 2:22 pm

ok

RewriteEngine On
RewriteBase /




#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# CATEGORIES
RewriteRule ^cat([0-9]+)\.html$ /index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forum([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^forum([0-9]+)\.html$ /viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^topic([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^topic([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L]
# PROFILES
RewriteRule ^member([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,L]
# 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]
# mxBB
RewriteRule ^mx-sitemap.xml$ /sitemap.php?mx [L]
# KB
RewriteRule ^kb-sitemap-([0-9]+).xml$ /sitemap.php?kbid=$1 [L]
RewriteRule ^sitemap-kbcat.xml$ /sitemap.php?kbcat [L]

#########################################################
# END GG_SITEMAPS REWRITE RULES #
#########################################################

RewriteRule ^(.*)(-c|-f|-t)([0-9]+)\.html$ http://www.mydomain.dk/phpbb/$1$2$3.html [QSA,L,R=301]

Last edited by euroman on Sun Aug 19, 2007 3:14 pm, edited 1 time in total.
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm

Next

Return to phpBB2 mod Rewrite

Who is online

Users browsing this forum: No registered users and 2 guests