[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

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

Ok I deleted the .htacces file in the forum dir. It works now kinda. The links from the topics-anywhere that is placed on my online store works. But my index is index.php instead of html. Also I can click on topics just not catagories. I.E. click on RSS/XML Now Available! which will take you directly to the thread, but if you try to click on any of the others it gives me a 404.
Silverado05
PR0
PR0
 
Posts: 51
Joined: Sat Jul 01, 2006 8:38 pm
Location: Texas

Advertisement

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

could you post your full .htaccess again please, if it works for topics it should work as well for all.
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: 21428
Joined: Fri Apr 28, 2006 9:03 pm

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

I fixed it, I think. It seems to be working now, But my index doesn't have an html ext it's php.

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/forum([0-9]+)-([0-9]+)\.html$ /forum/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^forum/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]

# rewrite for blog mod
RewriteRule ^blog/(.*)$ /forum/weblog.php?u=$1
RewriteRule ^blog/(.*)/$ /forum/weblog.php?u=$1


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

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

Now it is all working it seems ;)

You should just add this rewriterule for your old forum index links, it does not matter SEO wise if you use index.php instead :

Code: Select all
RewriteRule ^forum/forum\.html$ /forum/index.php [QSA,L,R=301]


Put it before :

Code: Select all
# CATEGORIES


Is joomla working ok ?

Then, you'll need to uncomment the proper lines of code in sessions.php (the part modded by this mod) so that you'll be able to turn mod rewrite on for mx sitemaps.

The auto link add on is as well your friend :D

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

Postby Silverado05 » Wed Aug 02, 2006 12:01 am

Ok what is this line of code suppose to do?

Code: Select all
RewriteRule ^forum/forum\.html$ /forum/index.php [QSA,L,R=301]



Yes my Joomla is working ok I assume. I followed their directions for SEO URL.
Silverado05
PR0
PR0
 
Posts: 51
Joined: Sat Jul 01, 2006 8:38 pm
Location: Texas

Postby dcz » Wed Aug 02, 2006 12:04 am

This code will just redirect forum.html, being your old index, to index.php, with no harm SEO wise as it's an http 301 header ;)

The old link will thus work, but only the new one will be kept final.

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

Postby Silverado05 » Wed Aug 02, 2006 12:13 am

I added that line but I get a 404 when I try to call

http://www.texascampingforum.com/forum/forums.html


Code: Select all
#########################################################
# PHPBB SEO REWRITE RULES            #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
RewriteRule ^forum/forum\.html$ /forum/index.php [QSA,L,R=301]
# CATEGORIES
RewriteRule ^forum/cat([0-9]+)\.html$ /forum/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forum/forum([0-9]+)-([0-9]+)\.html$ /forum/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^forum/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
#####################################################



Would it be hard to rewrite it so it's forums.html instead of index.php?

I don't know much about this but I read somewhere where Search Engines like the ext HTML instead of php. I don't know how much truth is to that though. I would perfer it to be HTML so that it follows the rule of the rest of the forum.

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

Postby dcz » Wed Aug 02, 2006 7:40 am

Sorry, I put forum where you uses forums.

So it's :

Code: Select all
RewriteRule ^forum/forums\.html$ /forum/index.php [QSA,L,R=301]


Now the only difference SEO wise does not come from the .html extension, it's index vs forums.

I first decided not to rewrite index.php for compatibility purposes and because it's not changing much SEO wises. Besides it's extra work for almost nothing for the server.

I'll see what I decide for the zero dupe, anyway, you'll be able to change this when you fell you are ready or willing to with no harm.
I suggested this rule because you need this old link to work.

As well you should take a look to the www prefix issue.

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

Re: [DEV] phpBB SEO Simple mod Rewrite V 0.0.2

Postby acapellas4u » Wed Aug 09, 2006 9:20 am

SeO wrote:....

(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.


Ok, couple of things.. I already have edited my sessions.php on 23rd May '06. I know this was for the Guest sessions thing as there is a file called 'sessions_b4_guest_sessions_mod.php' - I always name older files carefully so I know where I'm at.

I'm looking at my httpd.conf and I see that

Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so
is already uncommented for a start.. but where does one add
Code: Select all
AddModule mod_rewrite.c
?

How can I actually test to see that whatever I've changed within the sessions.php IS actually working?

Does this involve a restart of apache or something??

.. sorry to take the level down a peg or two but I do need more basic instruction sometimes.. this is quite a high level of tech going on here on this fine forum.

cheers.

Cheers
acapellas4u
PR0
PR0
 
Posts: 79
Joined: Tue Aug 08, 2006 3:33 pm

Re: [DEV] phpBB SEO Simple mod Rewrite V 0.0.2

Postby dcz » Wed Aug 09, 2006 10:31 am

acapellas4u wrote:
Ok, couple of things.. I already have edited my sessions.php on 23rd May '06. I know this was for the Guest sessions thing as there is a file called 'sessions_b4_guest_sessions_mod.php' - I always name older files carefully so I know where I'm at.


Good.
Cyber alien Guest session mod is IMHO the best SID removal method, worth switching.


acapellas4u wrote:I'm looking at my httpd.conf and I see that

Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so
is already uncommented for a start.. but where does one add
Code: Select all
AddModule mod_rewrite.c
?

How can I actually test to see that whatever I've changed within the sessions.php IS actually working?

Does this involve a restart of Apache or something??


Actually, the code changes proposed here are meant for easyphp which is an handy local php/mysql local solution.

So in your case it depends on which set up you're trying. If the mod_rewrite module was not previously loaded, I guess an Apache restart is a wise thing upon load.

Then, the sessions.php changes, together with all other needed php changes will just change the way link are outputted, when functional, you should see rewritten links outputted among the forum.
It is then the .htaccess to allow the use of those.

To first make sure if mod_rewrite is or not available, just implement the .htaccess without the php code changes, and try to load a rewritten link such as postxx.html, where xx is an actual post id, if you get redirected, then it works, if not check your .htaccess paths, if they are correct, then, mod_rewrite is most likely not 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: 21428
Joined: Fri Apr 28, 2006 9:03 pm

Re: [DEV] phpBB SEO Simple mod Rewrite V 0.0.2

Postby acapellas4u » Wed Aug 09, 2006 10:45 am

dcz wrote:.. So in your case it depends on which set up you're trying. If the mod_rewrite module was not previously loaded, I guess an Apache restart is a wise thing upon load.

Then, the sessions.php changes, together with all other needed php changes will just change the way link are outputted, when functional, you should see rewritten links outputted among the forum.
It is then the .htaccess to allow the use of those.


I'm fairly sure that httpd daemon will have been restarted since I changed the sessions.php (but how can I tell when it was last restarted?)

If I do need to actually restart the httpd daemon on the acas4u box, what do I need in the .htaccess exaclty and where should it be placed? - Hehe, I started getting mixed up with robots.txt then, my bad. I think this .htaccess file is WHY I haven't seen any links replaced.

But I have ONLY installed the Guest Sessions thing and possibly added the rewrite to the httpd.conf, I haven't done anymore than this..

* sorry, this muct be very painful for you *

regards..
acapellas4u
PR0
PR0
 
Posts: 79
Joined: Tue Aug 08, 2006 3:33 pm

Re: [DEV] phpBB SEO Simple mod Rewrite V 0.0.2

Postby dcz » Wed Aug 09, 2006 11:41 am

acapellas4u wrote:* sorry, this muct be very painful for you *


Don't worry it is not ;)

I think you just do not believe how simple it is actually :D

So first, where are you trying this, online or locally ?

For the online mod rewrite, it's most likely on if your are not freely hosted.

As said, upload the .htacccess and try a postxx.html url (where xx is an actual post id)

If you only get a 404 and your .htaccess is correct, then, mod rewrite may be not available, yet.

Then, sessions.php has nothing to deal with Apache settings, it's just a part of the phpBB script. Think of it as Apache being sort of a system in which php is running as a program (using the Apache environment to work).

The php suggested code change are the one that will have phpBB output rewritten links, the .htaccess is only telling Apache how to deal with those new URLs (could be seen as kind of a driver if we continue to compare Apache as the operating system and php as a program running in it).

So once you have make sure mod rewrite is on, you'll just need to perform the php code changes and you'll see the new URL show up and 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: 21428
Joined: Fri Apr 28, 2006 9:03 pm

Re: [DEV] phpBB SEO Simple mod Rewrite V 0.0.2

Postby acapellas4u » Fri Aug 11, 2006 12:22 pm

dcz wrote:So first, where are you trying this, online or locally ?


online.

dcz wrote:If you only get a 404 and your .htaccess is correct, then, mod rewrite may be not available, yet.

Then, sessions.php has nothing to deal with Apache settings, it's just a part of the phpBB script. Think of it as Apache being sort of a system in which php is running as a program (using the Apache environment to work).

The php suggested code change are the one that will have phpBB output rewritten links, the .htaccess is only telling Apache how to deal with those new URLs (could be seen as kind of a driver if we continue to compare Apache as the operating system and php as a program running in it).

So once you have make sure mod rewrite is on, you'll just need to perform the php code changes and you'll see the new URL show up and work ;)

++


Awesome help you are!
Last edited by acapellas4u on Fri Aug 11, 2006 12:44 pm, edited 1 time in total.
acapellas4u
PR0
PR0
 
Posts: 79
Joined: Tue Aug 08, 2006 3:33 pm

Postby acapellas4u » Fri Aug 11, 2006 12:44 pm

Just to add to this as I'm now feeling bloody brave enuff ( or totally stupid ) to tackle this Simple ReWrite Mod now..

I have a .htaccess already in the root on my server and it's content reflects some tweaks we had to do with the site, mainly for the file attachments mod to work.

Here it is: (and please can you advise if the mock-up .htaccess will be good)

EXISTING:

Code: Select all
DirectoryIndex index.html index.htm portal.php index.php
php_value max_execution_time 6200
php_value upload_max_filesize 10M
php_value memory_limit 50M
php_value post_max_size 10M


PROPOSED:
DirectoryIndex index.html index.htm portal.php index.php
php_value max_execution_time 6200
php_value upload_max_filesize 10M
php_value memory_limit 50M
php_value post_max_size 10M
Options +FollowSymlinks
RewriteEngine On
RewriteBase /

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


If you're wondering the DirectoryIndex line's purely as we have the EZportal installed.. no idea if that's THE best way to do it but been like it now for years so wouldn't like to alter it now JUST in case the Serch Engines have a bloody fit :)

thx for the help!
acapellas4u
PR0
PR0
 
Posts: 79
Joined: Tue Aug 08, 2006 3:33 pm

Postby acapellas4u » Fri Aug 11, 2006 1:13 pm

Ok, I don't actually think this guest session mod's working.

Can someone please try my site for me and proove this one way or another. Thanks

Secondly I HAVE put the above .htaccess into effect within the root of the site now.. does it look ok?? I could carry out a /topicxx.html and it worked, what next ?

I didn't really wnat to go any further until some kind sole anwers these points for me.

Cheers for sticking with THIS #1 pain in the ass
acapellas4u
PR0
PR0
 
Posts: 79
Joined: Tue Aug 08, 2006 3:33 pm

PreviousNext

Return to phpBB2 Simple mod rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests