diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 3dedf0ddd73af8e2b384989989d5fc12e008ce2b..ced4c3a2eb7c017d6d6dea82ded7fe2227475dcd 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3899,6 +3899,17 @@
       <key>Value</key>
       <string>https://my.secondlife.com/[AGENT_NAME]</string>
     </map>
+	<key>WebProfileNonProductionURL</key>
+	<map>
+		<key>Comment</key>
+		<string>URL for Web Profiles on Non-Production grids</string>
+		<key>Persist</key>
+		<integer>0</integer>
+		<key>Type</key>
+		<string>String</string>
+		<key>Value</key>
+		<string>https://my-demo.secondlife.com/[AGENT_NAME]</string>
+	</map>
     <key>HighResSnapshot</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 4f13c0c022e42d4cefe30c665b48c746b407b2b8..42c8f1d7271dbebec0cf81273462024fae2ba937 100755
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -34,13 +34,23 @@
 #include "llpanelpicks.h"
 #include "lltabcontainer.h"
 #include "llviewercontrol.h"
+#include "llviewernetwork.h"
 
 static const std::string PANEL_PICKS = "panel_picks";
 static const std::string PANEL_PROFILE = "panel_profile";
 
 std::string getProfileURL(const std::string& agent_name)
 {
-	std::string url = gSavedSettings.getString("WebProfileURL");
+	std::string url;
+
+	if (LLGridManager::getInstance()->isInProductionGrid())
+	{
+		url = gSavedSettings.getString("WebProfileURL");
+	}
+	else
+	{
+		url = gSavedSettings.getString("WebProfileNonProductionURL");
+	}
 	LLSD subs;
 	subs["AGENT_NAME"] = agent_name;
 	url = LLWeb::expandURLSubstitutions(url,subs);