diff --git a/plugins/API/Controller.php b/plugins/API/Controller.php
index 41234d5c9ac795ba2cf5196fc9fb46f40e96b5a2..416cc728de85f8070ad6270327b6e6da123c99e8 100644
--- a/plugins/API/Controller.php
+++ b/plugins/API/Controller.php
@@ -53,7 +53,7 @@ class Controller extends \Piwik\Plugin\Controller
 
         $ApiDocumentation = new DocumentationGenerator();
         $prefixUrls = Common::getRequestVar('prefixUrl', 'http://demo.piwik.org/', 'string');
-        if (!UrlHelper::isLookLikeUrl($prefixUrls)) {
+        if (!UrlHelper::isLookLikeUrl($prefixUrls) || strpos($prefixUrls, 'http') !== 0) {
             $prefixUrls = '';
         }
         return $ApiDocumentation->getApiDocumentationAsStringForDeveloperReference($outputExampleUrls = true, $prefixUrls);