Apache >1.3 has a function implemented that gets the real uri named original_uri() (util_script.c).
Let's say wordpress is located at http://example.com/wordpress .
A standard request looks like this:
GET /wordpress/wp-admin/install.php HTTP/1.1
Okey ... now apache original_uri(r) returns /wp-admin/index.php
So PHP global variable $_SERVER[ 'REQUEST_URI' ]; looks like "/wp-admin/index.php"
upgrade-functions.php , upgrade-schema.php:
$guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$guessurl is "http://example.com/wordpress" cool :)
But what if the request is forwarded by squid with default config in accel vhost mode.
Here goes ...
The request is:
GET http:///example.com/wordpress/wp-admin/install.php HTTP/1.1
Apache original_uri(r) returns http:///example.com/wordpress/wp-admin/install.php which is legal.
PHP global variable $_SERVERREQUEST_URI? is "http:///example.com/wordpress/wp-admin/install.php"
upgrade-functions.php , upgrade-schema.php:
$guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$guessurl is "http://example.comhttp://example.com/wordpress" not cool :(
The problem with this that values 'siteurl' and 'home' will be wrong in the options table.
This code solves the problem (replaceing it in both places):
$guessurl = eregi($schema . $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI']) ? preg_replace('|/wp-admin/.*|i', '', $_SERVER['REQUEST_URI']) : preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
APACHE: v2.2.4
OS: BSD
PHP: 5.2.4RC1-dev
SQUID: 2.6
Yours,
Aron Szabo