You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.3 KiB

Index: includes/bootstrap.inc
--- includes/bootstrap.inc.orig 2008-02-11 15:36:21 +0100
+++ includes/bootstrap.inc 2008-04-09 20:47:49 +0200
@@ -272,6 +272,7 @@
*/
function conf_init() {
global $base_url, $base_path, $base_root;
+ global $base_url_local;
// Export the following settings.php variables to the global namespace
global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access;
@@ -723,9 +724,22 @@
* generate an equivalent using other environment variables.
*/
function request_uri() {
+ global $base_url;
+ global $base_url_local;
if (isset($_SERVER['REQUEST_URI'])) {
$uri = $_SERVER['REQUEST_URI'];
+ if (isset($base_url) && isset($base_url_local)) {
+ $parts = parse_url($base_url_local);
+ if ( strlen($uri) >= strlen($base_url_local)
+ && substr($uri, 0, strlen($base_url_local)) == $base_url_local) {
+ $uri = $base_url . substr($uri, strlen($base_url_local));
+ }
+ elseif ( strlen($uri) >= strlen($parts["path"])
+ && substr($uri, 0, strlen($parts["path"])) == $parts["path"]) {
+ $uri = $base_url . substr($uri, strlen($parts["path"]));
+ }
+ }
}
else {
if (isset($_SERVER['argv'])) {
Index: sites/default/default.settings.php
--- sites/default/default.settings.php.orig 2007-12-20 10:35:10 +0100
+++ sites/default/default.settings.php 2008-04-09 20:47:32 +0200
@@ -126,6 +126,24 @@
# $base_url = 'http://www.example.com'; // NO trailing slash!
/**
+ * Local Base URL (optional).
+ *
+ * If you are running Drupal behind a reverse proxy, $base_url (see above)
+ * usually points to the URL of the reverse proxy. Drupal uses this for
+ * all sorts of external URLs. In order to correctly calculate sub-URLs
+ * below $base_url for embedded HTML forms, Drupal also has to know the
+ * URL on the local/origin server under which Drupal is contacted by the
+ * reverse proxy. This is what $base_url_local is for.
+ *
+ * Examples:
+ * $base_url_local = 'http://www.example.com:8080/drupal';
+ *
+ * It is not allowed to have a trailing slash; Drupal will add it
+ * for you.
+ */
+# $base_url_local = 'http://www.example.com:8080/drupal'; // NO trailing slash!
+
+/**
* PHP settings:
*
* To see what PHP settings are possible, including whether they can