From 8df38858aad75558f4ab3fbd3db56fe16ea32828 Mon Sep 17 00:00:00 2001 From: Marc Chung Date: Wed, 23 Apr 2014 23:51:31 -0700 Subject: [PATCH] Make WP_SITEURL smart by detecting if $WORDPRESS_DIR is set --- config/public/wp-config.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/public/wp-config.php b/config/public/wp-config.php index 6151b754e..04f4a930f 100644 --- a/config/public/wp-config.php +++ b/config/public/wp-config.php @@ -39,9 +39,14 @@ /** Database Charset to use in creating database tables. */ define("DB_CHARSET", "utf8"); +/** Support WORDPRESS_DIR */ +$siteurl = getenv("WORDPRESS_DIR"); /** Allows both foobar.com and foobar.herokuapp.com to load media assets correctly. */ -define("WP_SITEURL", "http://" . $_SERVER["HTTP_HOST"]); +if (!empty($siteurl)) + define("WP_SITEURL", "http://" . $_SERVER["HTTP_HOST"] . "/" . $siteurl); +else + define("WP_SITEURL", "http://" . $_SERVER["HTTP_HOST"]); /** WP_HOME is your Blog Address (URL). */ // define('WP_HOME', "http://" . $_SERVER["HTTP_HOST"]);