000-CMS
avatar CBAlexHeinrich
CBAlexHeinrich
25 May 2014

In some LAMP setups following behaviour might occur:

During the process of building the URI, Joomla (2.5.17) builds a wrong URI.
What happens is, that Joomla tries, in "Apache Mode", to build the URI by
concentating ...

{Protocol}, $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI].

But the Request-Uri in these setups contains the complete URI, namely ...

{Protocol}://{$_SERVER['HTTP_HOST']}/{$_SERVER['SCRIPT_NAME']}/{?$_SERVER['QUERY_STRING']

... so that the Joomla-built URI looks like this:

http://www.my-joomla-site.comhttp://www.my-joomla-site.com

Means to the User:

  1. Installation gets stuck at "Step 1"
  2. Calls to http://my-joomla-site.com result in a 404 error.

In order to correct this behaviour I changed the following piece(s) of code:

  1. /libraries/joomla/application/web.php: (Ln 987)
$uri = $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

to ...

$uri = $scheme . $_SERVER['HTTP_HOST'] . str_replace( $scheme . $_SERVER['HTTP_HOST'], '', $_SERVER['REQUEST_URI'] );
  1. /libraries/joomla/environment/uri.php: (Ln 173)
$theURI = 'http' . $https . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

to ...

$theURI = 'http' . $https . $_SERVER['HTTP_HOST'] . str_replace( 'http' . $https . $_SERVER['HTTP_HOST'], '', $_SERVER['REQUEST_URI'] );

This also happens in Joomla 3.3.0, but the code is a little different.

Regards, Alex

avatar CBAlexHeinrich CBAlexHeinrich - open - 25 May 2014
avatar allenzhao
allenzhao - comment - 25 May 2014

Hi Alex,
This repository is for the Joomla Issues Tracker, not for the CMS.
You might want to post this issue here
Thanks,
Allen

avatar CBAlexHeinrich
CBAlexHeinrich - comment - 25 May 2014

OK, Thanks,
Alex

avatar CBAlexHeinrich CBAlexHeinrich - change - 25 May 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-05-25 15:19:14
avatar CBAlexHeinrich CBAlexHeinrich - close - 25 May 2014
avatar CBAlexHeinrich CBAlexHeinrich - close - 25 May 2014

Add a Comment

Login with GitHub to post a comment