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  
 
   
301 redirect mxbb Portal's index.php page

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » mxBB Portal
::  
Author Message
Peter77
phpBB SEO Team
phpBB SEO Team


Joined: 10 May 2006
Posts: 512
Location: Michigan

301 redirect  mxbb Portal's index.php  pagePosted: Mon Nov 06, 2006 6:41 am    Post subject: 301 redirect mxbb Portal's index.php page

Hello dcz, was wondering if you could show us how to redirect our index.php using 301 like we did on this thread for phpbb.

thanks!
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

301 redirect  mxbb Portal's index.php  pagePosted: Mon Nov 06, 2006 9:35 am    Post subject: Re: 301 redirect mxbb Portal's index.php page

Sure Wink

Open :

index.php

Find :

Code:
$page_row = get_info(PAGE_TABLE, "page_id", $page_id);
$page_title = $page_row['page_name'];


After add :

Code:
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$uri = $_SERVER['REQUEST_URI'];
if ( empty($_GET) && empty($_POST) && strpos($uri, "index.$phpEx") ) {
      seo_redirect(PORTAL_URL);
}
if ( !isset($page_row['page_name']) ) {
      seo_redirect(PORTAL_URL);
   //message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
// www.phpBB-SEO.com SEO TOOLKIT END


Note that I implemented an additional redirection for when the page does not exist, will be http 301 redirected to portal's root as well Wink

This is again a version to work with the zero duplicate 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


Last edited by dcz on Mon Nov 06, 2006 9:35 pm; edited 2 times in total
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

301 redirect  mxbb Portal's index.php  pagePosted: Mon Nov 06, 2006 9:33 pm    Post subject: Re: 301 redirect mxbb Portal's index.php page

Sorry I forgot, we needed to change the way link is outputted as well Rolling Eyes

Open :
Code:
includes/page_header.php


Find :
Code:
   'U_INDEX' => append_sid(PORTAL_URL . 'index.'.$phpEx),

Replace with :
Code:
   'U_INDEX' => append_sid(PORTAL_URL),


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
Peter77
phpBB SEO Team
phpBB SEO Team


Joined: 10 May 2006
Posts: 512
Location: Michigan

301 redirect  mxbb Portal's index.php  pagePosted: Wed Nov 08, 2006 8:10 am    Post subject: Re: 301 redirect mxbb Portal's index.php page

I wanted to test this at least a day before giving feedback, and it works like a charm. Smile


dcz wrote:


Note that I implemented an additional redirection for when the page does not exist, will be http 301 redirected to portal's root as well Wink

This is again a version to work with the zero duplicate Wink

++

Here are you talking about pages of mxbb portal? ( index.php?page=12 ) because I remember we took care of that once... so here is what that part of the index.php looks like;

Code:
//
// Load default header
//

$page_id = $mx_request_vars->request('page', MX_TYPE_INT, 1);

$page_row = get_info(PAGE_TABLE, "page_id", $page_id);
$page_title .= $page_row['page_name'];
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$uri = strtolower($_SERVER['REQUEST_URI']);
if ( empty($_GET) && empty($_POST) && strpos($uri, "index.$phpEx") ) {
seo_redirect(PORTAL_URL);
}
if ( !isset($page_row['page_name']) ) {
seo_redirect(PORTAL_URL);
//message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( !isset($page_row['page_name']) )
{
   header("Status: 301 Moved Permanently", false, 301);
   header("Location:" . PORTAL_URL . "index.$phpEx");
   exit();
}
// www.phpBB-SEO.com SEO TOOLKIT END
include($mx_root_path . 'includes/page_header.'.$phpEx);


Is this right?
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

301 redirect  mxbb Portal's index.php  pagePosted: Wed Nov 08, 2006 9:39 am    Post subject: Re: 301 redirect mxbb Portal's index.php page

Well yes, but the old one is now left unused, I merged the two in one, so you just need :

Code:
//
// Load default header
//

$page_id = $mx_request_vars->request('page', MX_TYPE_INT, 1);

$page_row = get_info(PAGE_TABLE, "page_id", $page_id);
$page_title .= $page_row['page_name'];
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$uri = strtolower($_SERVER['REQUEST_URI']);
if ( empty($_GET) && empty($_POST) && strpos($uri, "index.$phpEx") ) {
seo_redirect(PORTAL_URL);
}
if ( !isset($page_row['page_name']) ) {
seo_redirect(PORTAL_URL);
//message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
include($mx_root_path . 'includes/page_header.'.$phpEx);


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
Peter77
phpBB SEO Team
phpBB SEO Team


Joined: 10 May 2006
Posts: 512
Location: Michigan

301 redirect  mxbb Portal's index.php  pagePosted: Thu Nov 09, 2006 4:47 am    Post subject: Re: 301 redirect mxbb Portal's index.php page

Thanks, dcz! Smile
Back to top
Peter77
phpBB SEO Team
phpBB SEO Team


Joined: 10 May 2006
Posts: 512
Location: Michigan

301 redirect  mxbb Portal's index.php  pagePosted: Thu Aug 30, 2007 9:08 am    Post subject: Re: 301 redirect mxbb Portal's index.php page

I've been wondering if you have upgraded your portal to the "gold" version of 2.8 yet? The index.php is a lot different Neutral . If it saves you time, Is there a way to add a rewrite rule in .htcacess instead of editing mxbb ?

:edit: solved by using
Code:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.site.com/ [R=301,L]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » mxBB Portal
Page 1 of 1

Navigation Similar Topics

Jump to: