diff --git a/.htaccess b/.htaccess
index 65d4ceafb0..69dddc9abb 100644
--- a/.htaccess
+++ b/.htaccess
@@ -15,9 +15,10 @@ php_value memory_limit 512M
RewriteEngine on
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+RewriteRule ^.well-known/host-meta /public.php?service=host-meta [QSA,L]
RewriteRule ^.well-known/carddav /remote.php/carddav/ [R]
RewriteRule ^.well-known/caldav /remote.php/caldav/ [R]
RewriteRule ^apps/([^/]*)/(.*\.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L]
RewriteRule ^remote/(.*) remote.php [QSA,L]
-Options -Indexes
\ No newline at end of file
+Options -Indexes
diff --git a/apps/user_webfinger/appinfo/install.php b/apps/user_webfinger/host-meta.php
similarity index 59%
rename from apps/user_webfinger/appinfo/install.php
rename to apps/user_webfinger/host-meta.php
index 00a533e781..30072a728b 100644
--- a/apps/user_webfinger/appinfo/install.php
+++ b/apps/user_webfinger/host-meta.php
@@ -3,9 +3,6 @@ $hostMetaHeader = array(
'Access-Control-Allow-Origin' => '*',
'Content-Type' => 'application/xml+xrd'
);
-$appInfoDir = __DIR__;
-$thisAppDir = dirname($appInfoDir);
-$appsDir = dirname($thisAppDir);
$ownCloudDir = dirname($appsDir);
$docRoot = $_SERVER['DOCUMENT_ROOT'];
try {
@@ -29,23 +26,7 @@ $hostMetaContents = "
Resource Descriptor
";
-@mkdir($hostMetaDir);
-$hostMeta = fopen($hostMetaPath, 'w');
-if(!$hostMeta) {
- die("Could not open " . $hostMetaPath . " for writing, please check permissions!");
-}
-if(!fwrite($hostMeta, $hostMetaContents, strlen($hostMetaContents))) {
- die("Could not write to " . $hostMetaPath . ", please check permissions!");
-}
-fclose($hostMeta);
-
-// write custom headers into .htaccess:
-$htaccess = fopen($hostMetaDir . '/.htaccess', 'w');
-//TODO: check compatibility!
-fwrite($htaccess, "
-\n");
foreach($hostMetaHeader as $header => $value) {
- fwrite($htaccess, "Header set " . $header . " \"" . $value . "\"\n");
+ header($header . ": " . $value);
}
-fwrite($htaccess, "\n");
-fclose($htaccess);
+echo $hostMetaContents;