diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php
index 19c9a4d8d765eb149a74f270d22deb09d0738f30..832194f0fe1ed32c33a3f35f944ee87009a8c3e4 100755
--- a/apps/calendar/templates/calendar.php
+++ b/apps/calendar/templates/calendar.php
@@ -19,7 +19,7 @@
 				var missing_field_totime = '<?php echo addslashes($l->t('To Time')) ?>';
 				var missing_field_startsbeforeends = '<?php echo addslashes($l->t('The event ends before it starts')) ?>';
 				var missing_field_dberror = '<?php echo addslashes($l->t('There was a database fail')) ?>';
-				var totalurl = '<?php echo OCP\Util::linkToAbsolute('remote.php', 'caldav'); ?>/calendars';
+				var totalurl = '<?php echo OCP\Util::linkToRemote('caldav'); ?>calendars';
 				var firstDay = '<?php echo (OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0'); ?>';
 				$(document).ready(function() {
 				<?php
diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php
index 0d6c8735ecc139d88de2909e9ce183540bd48b32..12117750ca55392beb3003553d17dc6bd01c10f2 100755
--- a/apps/calendar/templates/settings.php
+++ b/apps/calendar/templates/settings.php
@@ -47,6 +47,6 @@
         </table>
 
         <?php echo $l->t('Calendar CalDAV syncing address:');?>
-        <code><?php echo OCP\Util::linkToAbsolute('remote.php', 'caldav/'); ?></code><br />
+        <code><?php echo OCP\Util::linkToRemote('caldav'); ?></code><br />
         </fieldset>
 </form>
diff --git a/apps/calendar/templates/share.dropdown.php b/apps/calendar/templates/share.dropdown.php
index 0796a880f1faeda97656bbc8398771d122c5a23f..356a8d4fab14e26f8c20a423db860f7be90b095f 100755
--- a/apps/calendar/templates/share.dropdown.php
+++ b/apps/calendar/templates/share.dropdown.php
@@ -73,5 +73,5 @@ echo OCP\html_select_options($allgroups, array());
 </ul>
 <div id="public">
 	<input type="checkbox" id="publish" <?php echo ($public['share'])?'checked="checked"':'' ?>><label for="publish"><?php echo $l->t('make public'); ?></label><br>
-	<input type="text" id="public_token" value="<?php echo OCP\Util::linkToAbsolute('', 'public.php?service=calendar&t=' . $public['share'], null, true) ; ?>" onmouseover="$('#public_token').select();" style="<?php echo (!$public['share'])?'display:none':'' ?>">
-</div>
\ No newline at end of file
+	<input type="text" id="public_token" value="<?php echo OCP\Util::linkToAbsolute('', 'public.php').'?service=calendar&t=' . $public['share'] ?>" onmouseover="$('#public_token').select();" style="<?php echo (!$public['share'])?'display:none':'' ?>">
+</div>
diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php
index 791e3ced26c61dd3e47462c6ca74ffe72fdf6221..7d212e71ba830f096f8d8da68f1cb4168c69410b 100755
--- a/apps/contacts/templates/index.php
+++ b/apps/contacts/templates/index.php
@@ -1,5 +1,5 @@
 <script type='text/javascript'>
-	var totalurl = '<?php echo OCP\Util::linkToAbsolute('remote.php', 'carddav'); ?>/addressbooks';
+	var totalurl = '<?php echo OCP\Util::linkToRemote('carddav'); ?>addressbooks';
 	var categories = <?php echo json_encode($_['categories']); ?>;
 	var lang = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'core', 'lang', 'en'); ?>';
 </script>
diff --git a/apps/contacts/templates/settings.php b/apps/contacts/templates/settings.php
index ce14e52e0ce18a5668972708c4a55f9d38f42e86..216003b6c698938437807adb6dbb54317f88a5fb 100755
--- a/apps/contacts/templates/settings.php
+++ b/apps/contacts/templates/settings.php
@@ -4,9 +4,9 @@
 		<?php echo $l->t('CardDAV syncing addresses'); ?> (<a href="http://owncloud.org/synchronisation/" target="_blank"><?php echo $l->t('more info'); ?></a>)
 		<dl>
 		<dt><?php echo $l->t('Primary address (Kontact et al)'); ?></dt>
-		<dd><code><?php echo OCP\Util::linkToAbsolute('remote.php', 'carddav/'); ?></code></dd>
+		<dd><code><?php echo OCP\Util::linkToRemote('carddav'); ?></code></dd>
 		<dt><?php echo $l->t('iOS/OS X'); ?></dt>
-		<dd><code><?php echo OCP\Util::linkToAbsolute('remote.php', 'carddav/'); ?>principals/<?php echo OCP\USER::getUser(); ?></code>/</dd>
+		<dd><code><?php echo OCP\Util::linkToRemote('carddav'); ?>principals/<?php echo OCP\USER::getUser(); ?></code>/</dd>
 		</dl>
 		Powered by <a href="http://geonames.org/" target="_blank">geonames.org webservice</a>
 	</fieldset>
diff --git a/apps/media/lib_ampache.php b/apps/media/lib_ampache.php
index 510aba3f7e78bec241709f7353b395f44d715595..f5c91661abee3747c1f69ec30b446951b4261793 100755
--- a/apps/media/lib_ampache.php
+++ b/apps/media/lib_ampache.php
@@ -207,7 +207,7 @@ class OC_MEDIA_AMPACHE{
 		echo("\t\t<title>$name</title>\n");
 		echo("\t\t<artist id='$artist'>$artistName</artist>\n");
 		echo("\t\t<album id='$album'>$albumName</album>\n");
-		$url=OCP\Util::linkToAbsolute('remote.php', 'ampache/server/xml.server.php/')."?action=play&song=$id&auth={$_GET['auth']}";
+		$url=OCP\Util::linkToRemote('ampache')."server/xml.server.php/?action=play&song=$id&auth={$_GET['auth']}";
 		$url=self::fixXmlString($url);
 		echo("\t\t<url>$url</url>\n");
 		echo("\t\t<time>{$song['song_length']}</time>\n");
diff --git a/apps/media/templates/settings.php b/apps/media/templates/settings.php
index 162b52b8d9b7f709384b8d613f487280a40bd88d..a7dc0775c44784e440c46a2a7dc68fe3733b1b83 100755
--- a/apps/media/templates/settings.php
+++ b/apps/media/templates/settings.php
@@ -2,6 +2,6 @@
 	<fieldset class="personalblock">
 		<strong>Media</strong><br />
 		Ampache address: 
-		<code><?php echo OCP\Util::linkToAbsolute('remote.php', 'ampache'); ?>/</code><br />
+		<code><?php echo OCP\Util::linkToRemote('ampache'); ?></code><br />
 	</fieldset>
 </form>
diff --git a/index.php b/index.php
index b0b77969c57e5a7b11043e3186a190f676bfe15a..5d5307065bd7d36f2b6064c6a9973d36d36c7a93 100644
--- a/index.php
+++ b/index.php
@@ -44,7 +44,7 @@ if($not_installed) {
 
 // Handle WebDAV
 if($_SERVER['REQUEST_METHOD']=='PROPFIND'){
-	header('location: '.OC_Helper::linkToAbsolute('remote.php','webdav/'));
+	header('location: '.OC_Helper::linkToRemote('webdav'));
 	exit();
 }
 
diff --git a/lib/helper.php b/lib/helper.php
index 757f562bfed2189be83c52dece447f8d538a480b..f5e247ca9ebab9cea9c35dfc85319e1ca1472813 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -105,6 +105,17 @@ class OC_Helper {
 		return $urlLinkTo;
 	}
 
+	/**
+	 * @brief Creates an absolute url for remote use
+	 * @param $service id
+	 * @returns the url
+	 *
+	 * Returns a absolute url to the given service.
+	 */
+	public static function linkToRemote( $service ) {
+		return self::linkToAbsolute( '', 'remote.php') . '/' . $service . '/';
+	}
+
 	/**
 	 * @brief Creates path to an image
 	 * @param $app app
diff --git a/lib/public/util.php b/lib/public/util.php
index 6a8adff0f5a9ca4d5fc1d6a37062fc6708061cc0..f9f3759fe5bdb79557e8c7c18ce861d05e0b30a0 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -130,6 +130,18 @@ class Util {
 	}
 
 
+	/**
+	 * @brief Creates an absolute url for remote use
+	 * @param $service id
+	 * @returns the url
+	 *
+	 * Returns a absolute url to the given app and file.
+	 */
+	public static function linkToRemote( $service ) {
+		return(\OC_Helper::linkToRemote( $service ));
+	}
+
+
         /**
          * @brief Creates an url
          * @param $app app
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index 799606e6a9117c28a58d76743c49b94ac8c41549..014996a5b2071c5fd278fabe64c7c08a90449479 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -47,7 +47,7 @@
 
 <p class="personalblock">
 	<strong>WebDAV</strong>
-	<code><?php echo OC_Helper::linkToAbsolute('remote.php', 'webdav/'); ?></code><br />
+	<code><?php echo OC_Helper::linkToRemote('webdav'); ?></code><br />
 	<em><?php echo $l->t('use this address to connect to your ownCloud in your file manager');?></em>
 </p>