Add well-known redirects to htaccess
Fixes: http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-232 http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-445
This commit is contained in:
parent
b0e68d039c
commit
ea99e1184d
2 changed files with 9 additions and 1 deletions
|
@ -11,5 +11,7 @@ php_value memory_limit 512M
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
|
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
|
||||||
|
RewriteRule ^.well-known/carddav /apps/contacts/carddav.php [R]
|
||||||
|
RewriteRule ^.well-known/caldav /apps/calendar/caldav.php [R]
|
||||||
</IfModule>
|
</IfModule>
|
||||||
Options -Indexes
|
Options -Indexes
|
||||||
|
|
|
@ -296,15 +296,21 @@ class OC_Setup {
|
||||||
* create .htaccess files for apache hosts
|
* create .htaccess files for apache hosts
|
||||||
*/
|
*/
|
||||||
private static function createHtaccess() {
|
private static function createHtaccess() {
|
||||||
|
$content = "ErrorDocument 403 ".OC::$WEBROOT."/core/templates/403.php\n";//custom 403 error page
|
||||||
$content = "ErrorDocument 404 ".OC::$WEBROOT."/core/templates/404.php\n";//custom 404 error page
|
$content = "ErrorDocument 404 ".OC::$WEBROOT."/core/templates/404.php\n";//custom 404 error page
|
||||||
$content.= "<IfModule mod_php5.c>\n";
|
$content.= "<IfModule mod_php5.c>\n";
|
||||||
$content.= "php_value upload_max_filesize 512M\n";//upload limit
|
$content.= "php_value upload_max_filesize 512M\n";//upload limit
|
||||||
$content.= "php_value post_max_size 512M\n";
|
$content.= "php_value post_max_size 512M\n";
|
||||||
$content.= "SetEnv htaccessWorking true\n";
|
$content.= "php_value memory_limit 512M\n";
|
||||||
|
$content.= "<IfModule env_module>\n";
|
||||||
|
$content.= " SetEnv htaccessWorking true\n";
|
||||||
|
$content.= "</IfModule>\n";
|
||||||
$content.= "</IfModule>\n";
|
$content.= "</IfModule>\n";
|
||||||
$content.= "<IfModule mod_rewrite.c>\n";
|
$content.= "<IfModule mod_rewrite.c>\n";
|
||||||
$content.= "RewriteEngine on\n";
|
$content.= "RewriteEngine on\n";
|
||||||
$content.= "RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]\n";
|
$content.= "RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]\n";
|
||||||
|
$content.= "RewriteRule ^.well-known/carddav /apps/contacts/carddav.php [R]\n";
|
||||||
|
$content.= "RewriteRule ^.well-known/caldav /apps/calendar/caldav.php [R]\n";
|
||||||
$content.= "</IfModule>\n";
|
$content.= "</IfModule>\n";
|
||||||
$content.= "Options -Indexes\n";
|
$content.= "Options -Indexes\n";
|
||||||
@file_put_contents(OC::$SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it
|
@file_put_contents(OC::$SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it
|
||||||
|
|
Loading…
Reference in a new issue