diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php
index e10f0133c19ead4cad9969eccb40659e7e510924..69b11d115a653925493d157317e091a6451e2e38 100644
--- a/ecrire/inc/utils.php
+++ b/ecrire/inc/utils.php
@@ -677,6 +677,13 @@ function url_de_base() {
 	if ($url)
 		return $url;
 
+	// cas particulier des sites filtres par un proxy entrant
+	// cf. http://trac.rezo.net/trac/spip/ticket/401
+	if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
+		$a = $GLOBALS['meta']['adresse_site'];
+		return (substr($a,-1) == '/')?$a:$a.'/';
+	}
+
 	$http = (
 		(isset($_SERVER["SCRIPT_URI"]) AND
 			substr($_SERVER["SCRIPT_URI"],0,5) == 'https')