[Archive] phpBB SEO Simple mod Rewrite V 0.0.2

phpBB2 SEO Simple mod Rewrite support forum.
This mods performs a fully static URL rewriting for phpBB.
Simple and efficient.

Moderator: Moderators


[Archive] phpBB SEO Simple mod Rewrite V 0.0.2

Postby dcz » Thu May 25, 2006 8:22 pm

WARNING
    0.2.0 is out : To update please read this thread.

    What follows is kept for archive.

    0.0.2 support will continue for some time for 0.0.2 user, until they update.

    Do not use this version if you are first installing this mod.

---------------------------------------------------------------------------------------

[DEV] phpBB SEO Simple mod Rewrite V 0.0.2 - UPDATED

Before you do anything :

    Please read carefully this post, you will save time and will not risk to jeopardise your web-site's PageRanking.


Under construction Topic.

From now on, the English versions will see the profiles URL to be : memberxx.html (membrexx.html in the French one).

This mod is working fully with phpBB vanilla (unmodded), special patch may be required for some mods, like simple sub forum. Many of them already exist here.
It will not output any pagination duplicates.

You should think about which solution will best fit your forum project before you install any of the three phpBB SEO mod Rewrite.

As well you should think about your robots.txt as well as about the www prefix issue.

The mx Google Siteamps and mx Sitmaps are, off course, compatible, useful and a requirement to help out Search Engines to Crawl you site well.


You can as well find out a lot of interesting Search Engine Optimization (SEO) parameters thanks to our phpBB SEO webmaster Tools

You should perform test locally or on a test server before you use this setup on a live site. This will prevent many small path issues in .htaccess from becoming too stressing for you ;)

To load mod Rewrite with Easyphp :
Open EasyPHP1-8\conf_files\httpd.conf and uncomment
(get rid of the "#" at the beginning of the required lines) those two lines :

Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so


And :

Code: Select all
AddModule mod_rewrite.c


Don't forget to install the Cyber alien Guest session mod or any other SID removal method you may prefer.

Code: Select all
##############################################################
## MOD Title:       phpBB SEO Simple mod Rewrite
## MOD Author:       dcz <n/a> http://www.phpbb-seo.com/
## MOD Description:    This mod makes static URLs for phpBB
##          Please read the author notes BEFORE using this mod.
##          Check http://boards.phpbb-seo.com/phpbb-mod-rewrite/phpbb-seo-simple-mod-rewrite-vt45.html
##          for the latest version or to get help with this MOD
##
## MOD Version:    0.0.2
##
## Installation Level:    (Advanced)
## Installation Time:    3 Minutes
## Files To Edit:    (5)
##         .htaccess,
##         index.php,
##         includes/function.php,
##         includes/session.php,
##         viewtopic.php
##         search.php
## Included Files: n/a
##############################################################
## Author Notes:
##
## This mod require running Apache Server with mod_Rewrite On.
##
## This mod requires the Cyber Alien guest session mod (http://www.phpbbstyles.com/viewtopic.php?t=357).
##
## With this mod, your phpBB URL will change :
##
##   index.php?c=xx               =>   catxx.html
##
##   viewforum.php?t=xx            =>   forumxx.html
##
##   viewforum.php?t=xx&start=xx         =>   forumxx-yy.html
##
##   viewtopic.php?t=xx               =>   topicxx.html
##
##   viewtopic.php?t=xx&start=xx         =>   topicxx-yy.html
##
##   viewtopic.php?p=xx               =>   postxx.html
##
##   profile.php?mode=viewprofile&u=xx    =>   memberxx.html
##
## This mod has nothing in common with other phpBB mod rewrite, it will perform the URL rewriting
## without using ob_start(), thus faster and not messing anymore whith Gun-Zip nor with the html link format,
## and will not output any pagination duplicate.
##
## This is the lightest and easiest way to deal with phpBB SEO mod Rewrite. It will rewrite all phpBB URL built using
## the append_sid() phpBB function (e.g . all decent phpBB mods ;-) ) without any additional changes.
## No issue whatsoever.
##
## NOTE : phpBB SEO recommend the use of the phpBB SEO mixed mod Rewrite in almost all cases. But this mod can be very
## convenient to allow migration from other heavier static mod Rewrites outputting many duplicates.
## Please read : http://boards.phpbb-seo.com/phpbb-seo-toolkit/phpbb-seo-mod-rewrites-vt66.html
##
## This mod is and will be compatible to all phpBB SEO modules, specific install instructions may apply.
## phpBB SEO will provide patches to allow for other URL standards support upon request,
## so that everyone can take advantage of the phpBB mod Rewrites enhancement without jeopardising his Page-Ranking.
##
## Migrating from another mod Rewrite is as well possible but should be done with care to make sure you won't loose Page-Ranking.
##
####
## 0.0.1 => 0.0.2 Update : Required changes to be found in 0.0.1_.0.02_Simple_Update.txt
####
##
## LICENSE:
##
## We, phpBB SEO, have decided to license this mod under the RPL Licence ( http://www.opensource.org/licenses/rpl.php )
## which states you cannot remove the phpBB SEO credits and if you make any modifications you have to resubmit them
## to phpBB SEO for inclusion into this package again. You can read the license for yourself for further info.
##
## You can of course use this mod without any more limitations than those stated here and in the licence.
##
## At least a link ( http://www.phpbb-seo.com/ ) is required on every web site using this mod, or,
## if your web site does not comply with what phpBB SEO can link to, one proven link within a
## general audience hard link directory of your choice not already listing phpBB SEO.
## For more details about possible exeptions, please contact a phpBB SEO administrator (primarily SeO or dcz).
##
## Failure to comply will jeopardize support.
##
##############################################################
## MOD History:
##
##   2006-06-20 - 0.0.2
##      - Added highlight fix in search.php adn fixed a small bug in search results (results posts)
##      - Optimized the append_sid() filtering.
##
##   2006-05-25 - 0.0.1
##      - First Beta Version
##
##   2006-03-01 - 0.0.0
##      - Initial beta testing phase
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


Download phpBB SEO Simple mod Rewrite V 0.0.2
Download phpBB SEO Simple mod Rewrite V 0.0.2 - Categories Hierarchy (CH) Edition

The robots.txt :

The robots.txt file must be uploaded in your domain's root folder.

you must obviously change phpbb/ with your real phpBB installation folder (or with nothing if it's installed in the root).

Code: Select all
User-agent: *
Disallow: /phpbb/viewtopic.php
Disallow: /phpbb/viewforum.php
Disallow: /phpbb/index.php?
Disallow: /phpbb/posting.php
Disallow: /phpbb/groupcp.php
Disallow: /phpbb/search.php
Disallow: /phpbb/login.php
Disallow: /phpbb/privmsg.php
Disallow: /phpbb/post


This is the minimum required for bots to only consider the rewritten URLs.
The index.php? is absolutely normal and does not disallow index.php ;)

After this you can add :

Code: Select all
Disallow: /phpbb/member
Disallow: /phpbb/profile.php
Disallow: /phpbb/memberlist.php
Disallow: /phpbb/faq.php


If you don't want to put too much weight on those, by the way attractive to spammers. Will save some "useless" bot visits as well.

You may need to implement additional disallows if you changed URL standard for example.

French support for this mod.
Last edited by dcz on Tue Jan 23, 2007 2:24 am, edited 3 times in total.
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: 19909
Joined: Fri Apr 28, 2006 9:03 pm

Advertisement

Postby dcz » Wed Jun 21, 2006 12:06 pm

Updated to 0.0.2 ;)

Updating is very easy and will improve performance.

Besides, nothing will change for your phpBB 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: 19909
Joined: Fri Apr 28, 2006 9:03 pm

Postby dcz » Sun Jul 09, 2006 3:51 pm

I am currently working on enhancing phpBB links and to organise the phpBB SEO Toolkit. I thought the next and previous topic links should not be shown to guest any more as they are duplicates, and that this change was to be added in this mod, as it requires very few changes.

Here is the code change that will be added to the next version, you can implement it now as it's final ;)

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#


viewtopic.php


#
#-----[ FIND ]------------------------------------------
#

$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=previous");
$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=next");

//
// Mozilla navigation bar
//
$nav_links['prev'] = array(
   'url' => $view_prev_topic_url,
   'title' => $lang['View_previous_topic']
);
$nav_links['next'] = array(
   'url' => $view_next_topic_url,
   'title' => $lang['View_next_topic']
);


#
#-----[ REPLACE WITH ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ($userdata['session_logged_in']) {
$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=previous");
$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=next");

//
// Mozilla navigation bar
//
$nav_links['prev'] = array(
   'url' => $view_prev_topic_url,
   'title' => $lang['View_previous_topic']
);
$nav_links['next'] = array(
   'url' => $view_next_topic_url,
   'title' => $lang['View_next_topic']
);
}
// www.phpBB-SEO.com SEO TOOLKIT END

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


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

Postby macnack » Mon Jul 31, 2006 7:29 pm

Hello
I want to use simple mod rewrite with ch_phpbb but the instructions line in rewrite_mod I don´t find in my viewtopic.php
macnack
PR1
PR1
 
Posts: 101
Joined: Tue Jun 20, 2006 7:01 am
Location: Germany

Postby dcz » Mon Jul 31, 2006 10:14 pm

This patch is just meant for the standard edition, the CH edition does not edit anything in viewtopic.php.

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

Postby macnack » Tue Aug 01, 2006 4:22 am

Hello dcz
I mean this part
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#

viewtopic.php

#
#-----[ FIND ]------------------------------------------
#

//
// Send vars to template
//

#
#-----[ AFTER, ADD ]------------------------------------------
# Dans cette partie, vous pouvez choisir de ne pas utiliser de highlight, ce qui, d'un point de vue du référencment est
# plus efficace, mais cela retire un peu du confort utilisateur.
# Pour ce faire, retirez simplement la variable $highlight_ok dans le prochain [ REPLACE WITH ] et n'appliquez pas celui-ci.
#

// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$highlight_ok = ($highlight !='') ? "&amp;highlight=$highlight" : '';
// www.phpBB-SEO.com SEO TOOLKIT END

#
#-----[ FIND ]------------------------------------------
#

   'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start&amp;postdays=$post_days&amp;postorder=$post_order&amp;highlight=$highlight"),

#
#-----[ REPLACE WITH ]------------------------------------------
#
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start&amp;postdays=$post_days&amp;postorder=$post_order$highlight_ok"),
   // www.phpBB-SEO.com SEO TOOLKIT END
macnack
PR1
PR1
 
Posts: 101
Joined: Tue Jun 20, 2006 7:01 am
Location: Germany

Postby dcz » Tue Aug 01, 2006 9:51 am

Oh I see, you are running CH 2.16 ;)

No more of this code in it.

I don't think there could be any trouble with 2.16, but I have not tested yet.

Just don't care about this part then, or wait a slight bit until I do so ;)

Is it working good besides ?

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

Postby Silverado05 » Tue Aug 01, 2006 10:15 pm

dcz wrote:First you don't need to start twice the rewrite engine. As well, the mx sitemaps rules need the full path for this .htaccess located on level above in the root folder. And there should not be any rewriterules in the forum/ folder any more.


I tried it in both the forum .htaccess and the .htaccess in the root and it still doesn't work. Where should it be, in the root or the forum?

The index is pointing to where it is because of the the previous rewrite mod.

Their is no way I can make it work with the one I had installed?
Silverado05
PR0
PR0
 
Posts: 51
Joined: Sat Jul 01, 2006 8:38 pm
Location: Texas

Postby dcz » Tue Aug 01, 2006 10:24 pm

Silverado05 wrote:Their is no way I can make it work with the one I had installed?


Well, the two sitemaps module do support more than the phpBB SEO mod rewrites, but you cannot mix two different ones.
You can though, simply mod this one to use different static terms ("forum", "topic", "post" & "member"), but you'd have to take care about making sure the same changes are made everywhere on your site.

Then, I see you installed the mod properly, at least this time I can see rewritten links in the topic and search result pages, but they do not work.
This means it's the .htaccess.

It should be located in the root folder. Make sure the file transfer is correct and if it still does not work, try getting rid of all "/" in front of "forum/" ("/forum/" => "forum/") in the rewriterules.

and it should work, at least if mod_rewrite is loaded.

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

Postby Silverado05 » Tue Aug 01, 2006 10:36 pm

I was refrring to why couldn't I use the URL rewrite that I had that was working to work with the topic anywhere?

I made the changes in the .htacess in the root but still getting 404. Do I need to delete the .htaccess that is in the forum dir?

The first code is from my Joomla CMS, the forum rules are at the bottom.

Code: Select all
##
# @version $Id: htaccess.txt 4085 2006-06-21 16:03:54Z stingrey $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
# Only use one of the two SEF sections that follow.  Lines that can be uncommented
# (and thus used) have only one #.  Lines with two #'s should not be uncommented
# In the section that you don't use, all lines should start with #
#
# For Standard SEF, use the standard SEF section.  You can comment out
# all of the RewriteCond lines and reduce your server's load if you
# don't have directories in your root named 'component' or 'content'
#
# If you are using a 3rd Party SEF or the Core SEF solution
# uncomment all of the lines in the '3rd Party or Core SEF' section
#
#####################################################

#####  SOLVING PROBLEMS WITH COMPONENT URL's that don't work #####
# SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED
# OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING
#
# In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
# May need to be uncommented.  If you are running your Joomla/Mambo from
# a subdirectory the name of the subdirectory will need to be inserted into this
# line.  For example, if your Joomla/Mambo is in a subdirectory called '/test/',
# change this:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
# to this:
# RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR] ##optional - see notes##
#
#####################################################


##  Can be commented out if causes errors, see notes above.
# Options FollowSymLinks

#
#  mod_rewrite in use

RewriteEngine On


#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla/MamboDirectory (just / for root)

RewriteBase /


########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]       ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section



########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]       ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section

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


RewriteRule ^forum/sitemaps([0-9]+)\.html$ /forum/sitemaps.php?c=$1 [QSA,L]
RewriteRule ^forum/sitemaps\.html$ /forum/sitemaps.php [QSA,L]
RewriteRule ^forum/forum-m\ap\.html$ /forum/sitemaps.php?fim [QSA,L]
RewriteRule ^forum/forum-m\ap-([0-9]+)-([0-9]+)\.html$ /forum/sitemaps.php?fmp=$1&start=$2 [QSA,L]
RewriteRule ^forum/forum-m\ap-([0-9]+)\.html$ /forum/sitemaps.php?fmp=$1 [QSA,L]
Silverado05
PR0
PR0
 
Posts: 51
Joined: Sat Jul 01, 2006 8:38 pm
Location: Texas

Postby dcz » Tue Aug 01, 2006 10:46 pm

Try moving it all to the root.

we'll have to adapt the Joomla part, but it will be easier to deal with all those from just one place at least at first.

For the Joomla part try adding the path to :

Code: Select all
RewriteRule ^forum/(content/|component/) index.php


and it should work.

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

Postby Silverado05 » Tue Aug 01, 2006 11:14 pm

dcz wrote:Try moving it all to the root.

we'll have to adapt the Joomla part, but it will be easier to deal with all those from just one place at least at first.

For the Joomla part try adding the path to :

Code: Select all
RewriteRule ^forum/(content/|component/) index.php


and it should work.

++



It is all in the root now and it isn't working.


My phpBB isn't intergrated into Joomla. They are two seperate installations. I have the Joomla in the root and the forum in a sub-dir name forum. Is the line above still needed?

Do I need to delete the .htaccess file that is in the forum folder?

-Thanks
Silverado05
PR0
PR0
 
Posts: 51
Joined: Sat Jul 01, 2006 8:38 pm
Location: Texas

Postby dcz » Tue Aug 01, 2006 11:23 pm

Silverado05 wrote:
Do I need to delete the .htaccess file that is in the forum folder?

-Thanks


Yes. Just one .htacccess with rewriterules is the goal here.

Rewriterules and apache mod rewrite do not care about joomla or phpbb, they just deal with URLs and redirections. Moving the rules won't change anything as soon as they'll work ;)

While testing, make sure to check joomla's URLs as well.

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

Postby Silverado05 » Tue Aug 01, 2006 11:28 pm

Ok where exactly in the .htaccess file do I place?



Code: Select all
RewriteRule ^forum/(content/|component/) index.php


-Thanks
Silverado05
PR0
PR0
 
Posts: 51
Joined: Sat Jul 01, 2006 8:38 pm
Location: Texas

Postby dcz » Tue Aug 01, 2006 11:30 pm

where you have :

Code: Select all
RewriteRule ^(content/|component/) index.php
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: 19909
Joined: Fri Apr 28, 2006 9:03 pm

Next

Return to phpBB2 Simple mod rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest


 
cron