Moderator: Moderators


##
# @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 
RewriteRule ^forum/forum\.html$ /forum/index.php [QSA,L,R=301]# CATEGORIES 
RewriteRule ^forum/forum\.html$ /forum/index.php [QSA,L,R=301]


#########################################################
# 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
#####################################################

RewriteRule ^forum/forums\.html$ /forum/index.php [QSA,L,R=301] 
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.
LoadModule rewrite_module modules/mod_rewrite.soAddModule mod_rewrite.c 
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.
acapellas4u wrote:I'm looking at my httpd.conf and I see thatis already uncommented for a start.. but where does one add
- Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so?
- 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??

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.

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

dcz wrote:So first, where are you trying this, online or locally ?
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
++

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
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
#####################################################


Return to phpBB2 Simple mod rewrite
Users browsing this forum: No registered users and 1 guest