phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

mod_rewrite


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Wed Jan 21, 2009 11:40 am 
Post subject: mod_rewrite

Is it any good? icon_confused.gif I've heard that Google could be more interested in my website if he sees something like /britneyspears=3.php instead of /viewtopic=3.php
I even find a mod for this, but I want to here first what you guys think about these. icon_smile.gif

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

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Ptirhiik
Board Member



Joined: 19 Nov 2008

Posts: 114


flag
PostPosted: Wed Jan 21, 2009 6:54 pm 
Post subject: Re: mod_rewrite

Focus on your meta keywords rather than on your url: it will be much more efficient.
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Mon Jan 26, 2009 12:17 pm 
Post subject: Re: mod_rewrite

I already use Forum Meta Tags, but I was thinking that there's never too much for Google. icon_biggrin.gif
So mod_rewrite it is really that useless or just not so great? icon_confused.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
lumpy burgertushie
Board Member



Joined: 19 Nov 2008

Posts: 216


flag
PostPosted: Tue Jan 27, 2009 5:18 am 
Post subject: Re: mod_rewrite

wont' make any noticeable difference.

robert
Back to top
espicom
Board Member



Joined: 24 Nov 2008

Posts: 55
Location: Woodstock, IL


flag
PostPosted: Tue Jan 27, 2009 6:00 am 
Post subject: Re: mod_rewrite

Google's pagerank is important if your site is intended as a revenue source, or it is an extension of your ego. Otherwise, it's a source of additional load on your system.

That said, I have a site that is intended for a local group. They wanted a higher page ranking to attract new members. The quickest way I found to increase the PR is to simply set up an AdSense account, and put some AdSense advertising on the page. Part of making the ads "relevant" is spidering the pages... and the site in question picked up 12 places on the page rank for the keywords they club was looking for in 2 weeks.

The ads were placed across the bottom (just above the page footer) and limited to text, so as to minimize the arguments by the users. Being more aggressive than that might increase revenue slightly, but that wasn't why we did it. I think we've managed about $15 total revenue over the past 8 months on that particular site. But the ranking was worth it to them.

And all it took was modifying 3 template files...
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0187 seconds using 15 queries. (SQL 0.0023 Parse 0.0005 Other 0.0160)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo