diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
old mode 100644
new mode 100755
index 42701bcff91a93b414dfdaae004d6dbc77b44818..219fca66bd660e2c820742e3c244cde14ac6c5a9
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -56,6 +56,7 @@
 #include "llmutelist.h"
 #include "llnotificationsutil.h"	// for LLNotificationsUtil
 #include "llpaneloutfitedit.h"
+#include "llpanelprofile.h"
 #include "llrecentpeople.h"
 #include "llsidetray.h"
 #include "lltrans.h"
@@ -319,11 +320,9 @@ void LLAvatarActions::showProfile(const LLUUID& id)
 		std::string first_name,last_name;
 		if (gCacheName->getName(id,first_name,last_name))
 		{
-			llinfos << "opening web profile for " << first_name << "." << last_name << llendl;		
-			std::string url = gSavedSettings.getString("WebProfileURL");
-			LLSD subs;
-			subs["AGENT_NAME"] = first_name + "." + last_name;
-			url = LLWeb::expandURLSubstitutions(url,subs);
+			std::string agent_name = first_name + "." + last_name;
+			llinfos << "opening web profile for " << agent_name << llendl;		
+			std::string url = getProfileURL(agent_name);
 			LLWeb::loadURL(url);
 		}
 		else
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
old mode 100644
new mode 100755
index 00191b17bd4586f043dc45e6df0c220d294404ca..38683ab5f73fe05c94cfd65ef31617e0d2274a87
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -38,6 +38,16 @@
 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");
+	LLSD subs;
+	subs["AGENT_NAME"] = agent_name;
+	url = LLWeb::expandURLSubstitutions(url,subs);
+	LLStringUtil::toLower(url);
+	return url;
+}
+
 class LLProfileHandler : public LLCommandHandler
 {
 public:
@@ -50,10 +60,7 @@ class LLProfileHandler : public LLCommandHandler
 		if (params.size() < 1) return false;
 		std::string agent_name = params[0];
 		llinfos << "Profile, agent_name " << agent_name << llendl;
-		std::string url = gSavedSettings.getString("WebProfileURL");
-		LLSD subs;
-		subs["AGENT_NAME"] = agent_name;
-		url = LLWeb::expandURLSubstitutions(url,subs);
+		std::string url = getProfileURL(agent_name);
 		LLWeb::loadURL(url);
 
 		return true;
diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h
old mode 100644
new mode 100755
index 0546c1858337300983bf31ad65aa86e3a7530ccf..c330a15939202566bcfabe7d39eeb6aeeffac50b
--- a/indra/newview/llpanelprofile.h
+++ b/indra/newview/llpanelprofile.h
@@ -33,6 +33,8 @@
 
 class LLTabContainer;
 
+std::string getProfileURL(const std::string& agent_name);
+
 /**
 * Base class for Profile View and My Profile.
 */