First, thanks for this mod
I have just solved some annoying errors which were due to my peculiar configuration and I am posting my solution in case it helps anyone else.
On my site the forum and the main site run on separate servers, with a reverse squid proxy to send requests to the appropriate server. URLs are of the form domain.com/foo.html or domain.com/bar/baz.jpg etc. for the main content, and domain.com/forum/foo for the forum content. The forum server receives HTTP requests of the form "GET /forum/foo". The entry "The path where phpBB2 is located relative to the domain name" in the Configuration section is set to "/forum/".
The forum is actually installed in the server root directory, but the directory contains a symlink "forum" pointing to itself. The site configuration file in sites-available looks like this:
- Code: Select all
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/forum
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/forum/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
and in /var/forum we have the symlink
- Code: Select all
forum -> .
Since the URLs received by the forum server follow the same pattern as for a forum installed in a genuine subdirectory, I initially used the "folder install" version of .htaccess supplied with the mod (changing "phpbb" to "forum" to suit my site), and found that everything gave a 404 no matter what I did.
I found that it was actually necessary to use the "root install" version of .htaccess with all the leading slashes removed from the replacement part of the patterns. So my .htaccess now looks like this:
- Code: Select all
# You could need to un-comment the following line
# Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM INDEX (un-comment if used)
RewriteRule ^index\.html$ index.php [QSA,L,NC]
# FORUM PROTECTION RULE
# RewriteRule ^[a-z0-9_-]*/([^/]+\.html)$ index.php [R=301,L,NC]
# CATEGORIES
RewriteRule ^[a-z0-9_-]*-c([0-9]+)\.html$ index.php?c=$1 [QSA,L,NC]
# PAGINATED FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)-([0-9]+)\.html$ viewforum.php?f=$1&start=$2 [QSA,L,NC]
# FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)\.html$ viewforum.php?f=$1 [QSA,L,NC]
# PAGINATED TOPIC
RewriteRule ^[a-z0-9_-]*-t([0-9]+)-([0-9]+)\.html$ viewtopic.php?t=$1&start=$2 [QSA,L,NC]
# TOPIC
RewriteRule ^[a-z0-9_-]*-t([0-9]+)\.html$ viewtopic.php?t=$1 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ viewtopic.php?p=$1 [QSA,L,NC]
#PROFILES
RewriteRule ^member([0-9]+)\.html$ profile.php?mode=viewprofile&u=$1 [QSA,L,NC]
# END PHPBB PAGES
#####################################################
With that it all seems to be working.
I hope this helps anyone else with a similar setup.

English |
French
