phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Problem with PHPbb Forum sitemap!

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
::  
Author Message
Haxelsson



Joined: 17 Jan 2007
Posts: 4

Problem with PHPbb Forum sitemap!Posted: Thu Jan 25, 2007 10:16 am    Post subject: Problem with PHPbb Forum sitemap!

Hey i recently change my location of my forum, before the forum location was in the root now its in a subfolder: http://www.webbplanket.se/forum/

Now i get errors in google analytics:
Code:
 http://www.webbplanket.se/groupcp.php?g=13      404 (Hittades inte)   [?]      2007-jan-12
http://www.webbplanket.se/groupcp.php?g=14    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/groupcp.php?g=16    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/groupcp.php?g=19    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/groupcp.php?g=22    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/groupcp.php?g=23    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/groupcp.php?g=32    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/groupcp.php?g=33    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/groupcp.php?g=34    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/index.php?c=2    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/index.php?c=3    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/index.php?c=5    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/index.php?c=6    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/index.php?c=7    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/index.php?c=8    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewforum.php?f=12    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewforum.php?f=18    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewforum.php?f=27    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewforum.php?f=28    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewforum.php?f=29    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewforum.php?f=34    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=387    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewtopic.php?p=510    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=513    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewtopic.php?p=518    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewtopic.php?p=520    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=541    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=575    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=579    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=703    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=735    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=751    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=754    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=756    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=771    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=772    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=778    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?p=792    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?t=118    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewtopic.php?t=34    404 (Hittades inte)   [?]    2007-jan-12
http://www.webbplanket.se/viewtopic.php?t=75    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?t=81    404 (Hittades inte)   [?]    2007-jan-13
http://www.webbplanket.se/viewtopic.php?t=93


What shall i change in my sitemap.php?

Line 44-53:
Code:
   // YOU HAVE TO SET THE CORRECT PATH FOR PHPBB IF YOU WANT
   // TO USE THIS  SITEMAP SYSTEM OUTSIDE OF THE PHPBB FOLDER
   // AND TO LOOK AT LINE 70 too ;-)
   $module_root_path2 = $module_root_path = $phpbb_root_path = './';
   include($phpbb_root_path . 'extension.inc');
   include($phpbb_root_path . 'common.'.$phpEx);
   // Start session management
   $userdata = session_pagestart($user_ip, PAGE_INDEX);
   init_userprefs($userdata);
   // End session management


What shall i do to fix this? I moved my forum from http://www.webbplanket.se/ to http://www.webbplanket.se/forum/ because im currently building a website now and i still want to keep my forum but in a subfolder.
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13994

Problem with PHPbb Forum sitemap!Posted: Thu Jan 25, 2007 12:34 pm    Post subject: Re: Problem with PHPbb Forum sitemap!

Well all is normal, these pages do not exist any more and are not HTTP 301 redirected, so, they end up 404.

Your sitemaps is working nicely with correct path and urls : -http://www.webbplanket.se/forum/sitemap.php?fid=10

But Google will continue to try the older ones.

You can upload these two file at the root level to redirect the older links :


viewtopic.php :
Code:
<?php
/**
*
* @package phpBB SEO redirection suite
* @version $Id: phpbb_seo_class.php,v 1.0 2006/12/09 13:48:48 dcz Exp $
* @copyright (c) 2006 dcz - www.phpbb-seo.com
* @http://opensource.org/licenses/gpl-license.php GNU General Public License v2
*
*/

define('IN_PHPBB', true);
// You need here to set the correct path to your forum !!!
$phpbb_root_path = './phpBB/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start initial var setup
//
$topic_id = $post_id = 0;
$url = '';
if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) )
{
   $topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);
}
else if ( isset($HTTP_GET_VARS['topic']) )
{
   $topic_id = intval($HTTP_GET_VARS['topic']);
}

if ( isset($HTTP_GET_VARS[POST_POST_URL]))
{
   $post_id = intval($HTTP_GET_VARS[POST_POST_URL]);
}


$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
$start = ($start < 0) ? 0 : $start;
if (!$topic_id && !$post_id)
{
   message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
$server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name']));
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : '';
$script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path']));
$script_name = ($script_name == '') ? '' : $script_name . '/';
$root_url = $server_protocol . $server_name . $server_port . '/';
$phpbb_url = $root_url . $script_name;
if ($topic_id) {
   if ( !empty($db) ) {
      $db->sql_close();
   }
   $url = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id";
   header("HTTP/1.1 301 Moved Permanently", TRUE, 301);
   header("Location: " . $phpbb_url . $url);
   exit();
} elseif ($post_id) {
   if ( !empty($db) ) {
      $db->sql_close();
   }
   $url = "viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id";
   header("HTTP/1.1 301 Moved Permanently", TRUE, 301);
   header("Location: " . $phpbb_url . $url);
   exit();
} else {
   if ( !empty($db) ) {
      $db->sql_close();
   }
   $url = "index.$phpEx";
   header("HTTP/1.1 301 Moved Permanently", TRUE, 301);
   header("Location: " . $phpbb_url);
   exit();
}

?>


And viewforum.php :
Code:

<?php
/**
*
* @package phpBB SEO redirection suite
* @version $Id: phpbb_seo_class.php,v 1.0 2006/12/09 13:48:48 dcz Exp $
* @copyright (c) 2006 dcz - www.phpbb-seo.com
* @http://opensource.org/licenses/gpl-license.php GNU General Public License v2
*
*/
define('IN_PHPBB', true);
// You need here to set the correct path to your forum !!!
$phpbb_root_path = './phpBB/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start initial var setup
//
if ( isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]) )
{
   $forum_id = ( isset($HTTP_GET_VARS[POST_FORUM_URL]) ) ? intval($HTTP_GET_VARS[POST_FORUM_URL]) : intval($HTTP_POST_VARS[POST_FORUM_URL]);
}
else if ( isset($HTTP_GET_VARS['forum']))
{
   $forum_id = intval($HTTP_GET_VARS['forum']);
}
else
{
   $forum_id = '';
}

$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
$start = ($start < 0) ? 0 : $start;

$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
$server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name']));
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : '';
$script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path']));
$script_name = ($script_name == '') ? '' : $script_name . '/';
$root_url = $server_protocol . $server_name . $server_port . '/';
$phpbb_url = $root_url . $script_name;
if (!empty($forum_id)) {
   if ( !empty($db) ) {
      $db->sql_close();
   }
   $url = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id";
   header("HTTP/1.1 301 Moved Permanently", TRUE, 301);
   header("Location: " . $phpbb_url . $url);
   exit();
} else {
   if ( !empty($db) ) {
      $db->sql_close();
   }
   $url = "index.$phpEx";
   header("HTTP/1.1 301 Moved Permanently", TRUE, 301);
   header("Location: " . $phpbb_url);
   exit();
}

?>


Just make sure you replace phpBB/ with the real phpBB folder name in these, and upload them at the root level, everything should be HTTP 301 redirected for topics and forums.

I guess you can juste disallow /groupcp.php in robots.txt.

Google will find the new ones in time Wink

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Haxelsson



Joined: 17 Jan 2007
Posts: 4

Problem with PHPbb Forum sitemap!Posted: Thu Jan 25, 2007 6:48 pm    Post subject: Re: Problem with PHPbb Forum sitemap!

Thank you so much!

I updated my robot.txt file to Wink
Code:
User-agent: *
Disallow: /admin/
Disallow: /groupcp.php
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: