[Bb-trac] [bbPress] #1126: repermalink fails,
causing redirect loop on SunOS (Solaris?), and 404 errors.
bbPress
bb-trac at lists.bbpress.org
Thu Jun 25 02:43:41 GMT 2009
#1126: repermalink fails, causing redirect loop on SunOS (Solaris?), and 404
errors.
------------------------+---------------------------------------------------
Reporter: SteveBooth | Owner:
Type: defect | Status: new
Priority: high | Milestone: 1.0
Component: Front-end | Version: 1.0-rc-1
Severity: major | Keywords: Sun SunOS Solaris bb_repermalink redirect loop 404 error
------------------------+---------------------------------------------------
My web site is hosted on Concentric. Concentric 'Unix' servers appear to
be SunOS machines. (You can browse to a phpinfo running on my server here:
( http://stevenmbooth.com/phpinfo.php ) This server provides the following
$_SYSTEM variable values when the bb_repermalink routine is invoked from
line 5 of index.php in the root directory of bbPress:
REQUEST_URI: '' (i.e. emptry)
SCRIPT_NAME: '/bbpress/index.php'
PHP_SELF: '/bbpress/index.php'
SERVER_NAME: 'stevenmbooth.com'
The fact that REQUEST_URI is null causes bb_repermalink to generate a 404
error when index.php is invoked (or, obviously, anyone browses to the root
for bbPress.)
Concentric is one of the largest hosting platforms, having spun off from
Microsoft several years ago. I would think that Sun support would be
fairly important to bbPress.
After reviewing a lot of the code in bb_repermalink, my evaluation is that
there are numerous assumptions made about the contents of system variables
(in particular REQUEST_URI), that the code is insufficiently rigorous
about detecting permalinks (it seems to attempt to redirect uri's that
could not possibly be permalinks), and generally is going to be a
significant problem with cross-platform support in future versions of
bbPress.
My recommendation is, first, to install code similar to this (derived from
an plugin supplied by _ck_). I coded it at the front of my bb_repermalink,
and it helped, but didn't solve all the problems:
{{{
if (isset($_SERVER['REQUEST_URI']))
$uri = $_SERVER['REQUEST_URI'];
else if(isset($_SERVER['SCRIPT_NAME']))
$uri = $_SERVER['SCRIPT_NAME'];
else
$uri = $_SERVER['PHP_SELF'];
if (isset($_SERVER['SERVER_NAME']))
$uri = $_SERVER['SERVER_NAME'] . $uri . 'index.php';
}}}
However, the uri that this generates is of the form:
http://stevenmbooth.com/bbpress/index.php
Which causes repermalink to create, once again, an endless redirection
loop.
More work clearly needs to be done to handle SunOS/Solaris environments,
and any system that does not properly supply REQUEST_URI.
(This is 1.0 code by the way. I'm not sure which RC it is (if you tell me
where to look, I can tell you) but I think it's RC3.)
--
Ticket URL: <http://trac.bbpress.org/ticket/1126>
bbPress <http://bbpress.org/>
Innovative forum development
More information about the Bb-trac
mailing list