SEO 1 Links

  SEO Blog
  SEO Forum

  Active Topics
  Register
  Memberlist
  FAQ
  Search




SEO Forums

  SEO Forum
  SEM Forum

  Directories
  Link Networks
  Mod Rewrite
  Content
  Revenue Networks

  Marketing
  Social Bookmarking
  Webmastering

  Google
  Yahoo
  MSN

  Search
  Engines

  Link Exchange



Welcome

Time Now:
Sat Nov 18, 2017 4:06 pm

All times are GMT

Log in

Username:

Password:

 





 





Who is Online



Most users ever online in a day was 2917 on Thu Oct 25, 2007 4:43 pm
 



Member Websites

Free Sitewide Links
For Top Members





SEO 1 Forums > Mod Rewrite >

phpBB Mod Rewrite



Author Thread
Andrew
Senior Member


Joined: 21 Feb 2005
Good Posts: 997
Location: apache/domlogs
phpBB Mod Rewrite  Reply with quote  

For reference, I'm posting the phpBB Mod Rewrite Hack.

Obviously, you've got to use the Apache operating system to take advantage of Mod Rewrite, but this hack is fairly easy:

code:

##############################################################
## MOD Title: mod_rewrite
## MOD Author: wGEric < eric@egcnetwork.com > (Eric Faerber) http://eric.best-1.biz
## MOD Description: Use mod_rewrite on your board.  It converts your dynamic links to something
##          more Search Engine Friendly
## MOD Version: 1.0.0
##
## Installation Level: Easy/
## Installation Time: 10 Minutes
## Files To Edit: includes/page_header.php
##        includes/page_footer.php
##        .htaccess (may need to)
## Included Files: .htaccess (may need to use)
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##   This MOD requires that mod_rewrite is enabled on your server and
##   supports .htaccess.
##
##   If your server doesn't support .htaccess you will need to add the
##   rewrite rules to your server configuration.  I will not help you
##   do this.  You will be on your own.
##
##   If you already have a .htaccess file in the main directory of your,
##   you will need to add the contents of the .htaccess file that is included
##   to your exsisting file.
##
##   If you don't have a .htaccess file in the main directory of your site
##   you will need to copy the one that is included with this MOD.
##
##############################################################
## MOD History:
##
##   2004-01-12 - Version 1.0.0
##      - First Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


#
#-----[ COPY ]------------------------------------------
#
# Only do if you don't already have a .htaccess file in the main directory
# of your site.  See Author Notes for more information
#

copy .htaccess to .htaccess


#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php


#
#-----[ FIND ]------------------------------------------
#
# Note: this line has been shortened.  The full line is
#   $template->set_filenames(array(
#      'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
#   );
#
$template->set_filenames(array(
   'overall_header' =>
);

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

ob_start();
function replace_mod_rewrite($s)
{
   $urlin = array(
      "'(?<!/)viewforum.php\?f=([0-9]*)&amp;topicdays=([0-9]*)&amp;start=([0-9]*)'",
      "'(?<!/)viewforum.php\?f=([0-9]*)&amp;mark=topics'",
      "'(?<!/)viewforum.php\?f=([0-9]*)'",

      "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=previous'",
      "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=next'",
      "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=newest'",
      "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;start=([0-9]*)'",      "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;highlight=([a-zA-Z0-9]*)'",
      "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)'",
      "'(?<!/)viewtopic.php\?t=([0-9]*)'",
      "'(?<!/)viewtopic.php\?p=([0-9]*)'");

   $urlout = array(
      "viewforum\\1-\\2-\\3.php",
      "mforum\\1.php",
      "forum\\1.php",

      "ptopic\\1.php",
      "ntopic\\1.php",
      "newtopic\\1.php",
      "ftopic\\1-\\2-\\3-\\4.php",
      "ftopic\\1-\\2-\\3-\\4-\\5.php",
      "ftopic\\1-\\2.php",
      "ftopic\\1.php",
      "sutra\\1.php");

   $s = preg_replace($urlin, $urlout, $s);

   return $s;
}

#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php

#
#-----[ FIND ]------------------------------------------
#
$db->sql_close();

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

$contents = ob_get_contents();
ob_end_clean();
echo replace_mod_rewrite($contents);
global $dbg_starttime;


#
#-----[ FIND ]------------------------------------------
#
   $gzip_contents = ob_get_contents();
   ob_end_clean();

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

   
   echo replace_for_mod_rewrite($contents);
   global $dbg_starttime;

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM




_____________________________________________

.htacess file

Create this file in your forum's root directory, or add it's contents to an existning .htaccess file.

code:

RewriteEngine On
RewriteRule ^forums.* /index.php


RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*).* /viewforum.php?f=$1&topicdays=$2&start=$3
RewriteRule ^mforum([0-9]*).* /viewforum.php?f=$1&mark=topic
RewriteRule ^forum([0-9]*).* /viewforum.php?f=$1

RewriteRule ^ptopic([0-9]*).* /viewtopic.php?t=$1&view=previous
RewriteRule ^ntopic([0-9]*).* /viewtopic.php?t=$1&view=next
RewriteRule ^newtopic([0-9]*).* /viewtopic.php?t=$1&view=newest
RewriteRule ^ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* /viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4
RewriteRule ^ftopic([0-9]*)-([0-9]*)-([0-9]*)-([a-zA-Z]*)-([a-zA-Z]*).* /viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5
RewriteRule ^ftopic([0-9]*)-([0-9]*).* /viewtopic.php?t=$1&start=$2
RewriteRule ^ftopic([0-9]*).* /viewtopic.php?t=$1
RewriteRule ^sutra([0-9]*).* /viewtopic.php?p=$1




Last edited by Andrew on Fri Feb 03, 2006 4:21 am; edited 2 times in total
Post Tue Jan 31, 2006 10:05 pm
 View user's profile Send private message Visit poster's website
hoptoo
Senior Member


Joined: 16 Mar 2005
Good Posts: 203
Location: Hoptoo's Doppelganger
 Reply with quote  

That looks like the one I use on a couple of phpbb boards.
http://pokerforum.stackcheck.com/general-player-topics-vf13.html

See the able2know.com thread on this for the holy grail of phpbb optimization

http://www.able2know.com/forums/about15132.html

Couldnt get it to work on this smallville forum, but i think its form the MX portal changes I had previouly made.
Post Wed Feb 01, 2006 12:41 am
 View user's profile Send private message Visit poster's website
Andrew
Senior Member


Joined: 21 Feb 2005
Good Posts: 997
Location: apache/domlogs
 Reply with quote  

Thanks hoptoo.

That reminds me to mention that removing SIDs for the Search Bots is even more important that the mod_rewrite, so make sure to get that if you are going to the trouble to rewrite your forum.
Post Wed Feb 01, 2006 3:23 pm
 View user's profile Send private message Visit poster's website
xboxundone
Senior Member


Joined: 04 Mar 2005
Good Posts: 243

 Reply with quote  

yes mod rewrite is GREAT :)


Post Thu Feb 02, 2006 8:45 pm
 View user's profile Send private message Visit poster's website
ibold
Preferred Member


Joined: 09 Dec 2005
Good Posts: 169
Location: Reading, PA, USA
 Reply with quote  

quote:
Originally posted by xboxundone
yes mod rewrite is GREAT :)


Tru that..thanks for the mod, I'm about to give it a go on my latest forum :)


iPowerWeb Review | The Meaning of Dreams
Post Thu Feb 02, 2006 9:20 pm
 View user's profile Send private message Visit poster's website
justicewhite
Senior Member


Joined: 12 Aug 2005
Good Posts: 811

 Reply with quote  

Is there any performance impact on the phpBB forum apart from the usual mod rewrite?


Estate Agents Maidenhead | | Letting Agents Maidenhead
Post Mon Feb 06, 2006 9:28 pm
 View user's profile Send private message Visit poster's website
xboxundone
Senior Member


Joined: 04 Mar 2005
Good Posts: 243

 Reply with quote  

quote:
Originally posted by justicewhite
Is there any performance impact on the phpBB forum apart from the usual mod rewrite?


nope runs just as smooth.


Post Mon Feb 06, 2006 10:05 pm
 View user's profile Send private message Visit poster's website
cheapdomainseller
Senior Member


Joined: 01 Mar 2006
Good Posts: 336

 Reply with quote  

Just about to give this one a go now, i'll let you guys/girls know how it goes.

What version of PHP is the above script for?

As I had trouble finding the first bit of data. in the first file that needs to be open.
Post Wed Mar 01, 2006 11:59 am
 View user's profile Send private message Visit poster's website
cheapdomainseller
Senior Member


Joined: 01 Mar 2006
Good Posts: 336

 Reply with quote  

Hi Andew,

no luck with this one, is there an update for this script or another mod about?




-----UPDATE
Another mod which i was successful installing:
http://www.phpbb4you.com/phpbb-static-url-hack.html


Cheap domain registrations - Very cheap domain name prices.
Post Mon Mar 06, 2006 7:13 am
 View user's profile Send private message Visit poster's website
michael
Contributing Member


Joined: 07 Mar 2006
Good Posts: 27

 Reply with quote  

quote:
Originally posted by cheapdomainseller
Hi Andew,

no luck with this one, is there an update for this script or another mod about?




-----UPDATE
Another mod which i was successful installing:
http://www.phpbb4you.com/phpbb-static-url-hack.html


I couldn't get the other one working either, but got this one working, one problem with it is the session stuff adds to the end of the HTML part.
Post Tue Mar 07, 2006 10:19 am
 View user's profile Send private message Visit poster's website
pda
Full Member


Joined: 31 Mar 2006
Good Posts: 61

 Reply with quote  

I did some phpbb seo stuff about 2 years ago on my forum but cant remember now what it was,i think i removed session ID,s for the bots.

My pages look like this:

forum/viewtopic.php?t=6569

Would i be better off using the mod above ?
Post Sat Apr 01, 2006 12:38 am
 View user's profile Send private message Visit poster's website
ltcobretti
Preferred Member


Joined: 30 Jan 2006
Good Posts: 120

 Reply with quote  

Why are SID's bad ?


Webmaster Resources | Honda Generators | Hardwood Flooring
Post Wed Apr 12, 2006 8:39 pm
 View user's profile Send private message Visit poster's website
cheapdomainseller
Senior Member


Joined: 01 Mar 2006
Good Posts: 336

 Reply with quote  

ltcobretti: Why are SID's bad ?

I think the main reason they are bad is because google see's each SID as a new page, that means each time google spiders your page they think you have created a new page.

BTW people:
I've used the following mod-rewrte recently.
http://www.phpbb.com/phpBB/viewtopic.php?t=150631&highlight=rewrite


Cheap domain registrations - Very cheap domain name prices.
Post Fri Sep 15, 2006 7:24 am
 View user's profile Send private message Visit poster's website
Andrew
Senior Member


Joined: 21 Feb 2005
Good Posts: 997
Location: apache/domlogs
 Reply with quote  

Google does index pages with SIDs, I think, but I've seen Googlebot be much happier with my forums after removing the SIDs. Much more spidering and indexing.

Here's a hack which includes the mod_rewrite and SIDs all in one, that might be of interest....

http://www.phpbbhacks.com/download/2040
Post Fri Sep 15, 2006 6:45 pm
 View user's profile Send private message Visit poster's website
cheapdomainseller
Senior Member


Joined: 01 Mar 2006
Good Posts: 336

 Reply with quote  

Actually I'm wrong about how it sees it as a seperate page.
but it looks ugly in google, lol hehe

Example of SID in results:
http://www.google.com.au/search?sourceid=navclient&ie=UTF-8&rls=GGLJ,GGLJ:2006-14,GGLJ:en&q=google+and+phpbb+sid


Cheap domain registrations - Very cheap domain name prices.
Post Sat Sep 16, 2006 2:56 am
 View user's profile Send private message Visit poster's website
Goto page
1, 2  Next

Reply to topic
Jump to:  
Display posts from previous:      






SEO 1 © 2005-2015 - SEO 1 the SEO Forum