owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.39k stars 2.05k forks source link

.htaccess contains absolute path #960

Closed rrupi closed 10 years ago

rrupi commented 11 years ago

The .htaccess contains absolute paths in several RewriteRule statements. This breaks webfinger and some cardav/caldav links if owncloud is installed in a subdirectory.

Changing the rules to relative links should have no impact if installed in a webroot. However an Alias statement is still needed if installed in a subdirectory - the documentation is somewhat unclear on this (manually creating a link).

fixed .htaccess rules:

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/calendar/caldav.php remote.php/caldav/ [QSA,L]
RewriteRule ^apps/contacts/carddav.php remote.php/carddav/ [QSA,L]
RewriteRule ^apps/([^/]*)/(.*\.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L]
RewriteRule ^remote/(.*) remote.php [QSA,L]

example alias statement:

Alias /.well-known /var/www/owncloud/.well-known
BernhardPosselt commented 11 years ago

Please create a Pull request

karlitschek commented 11 years ago

Please also note that the webfinger and remote storage apps are no longer shipped. so the .well-known link is no longer there in ownCloud 5.

rrupi commented 11 years ago

Well.. sorry but forking on github checking in and creating a pull request seems a little excessive for the deletion of some slashes..

LukasReschke commented 11 years ago

Well.. sorry but forking on github checking in and creating a pull request seems a little excessive for the deletion of some slashes..

Hint: You can also edit files online with the Github editor ;-)

karlitschek commented 11 years ago

The change might be small if you count characters. But it can have a big impact on users. So wee need a pull request and reviews. Sorry for the hazel :-)

BernhardPosselt commented 11 years ago

@rrupi also jenkins runs all tests for each new pull request, so its not as excessive as one might think

jancborchardt commented 11 years ago

I’m closing this issue because it has been inactive for a few months. This probably means it’s not reproducible or it has been fixed in a newer version.

Please reopen if the error still persists with the latest stable version (currently ownCloud 5.0.9) and then please use the issue template. You an also contribute directly by providing a patch – see the developer manual. :)

Thank you!

sgparry commented 10 years ago

This is still an issue with owncloud 6.0a is proving a real PITA as currently it is one of a number of issues that are preventing my owncloud instance from supporting webfinger whether I configure it as a sub-domain or as a sub-directory. Please reopen.

karlitschek commented 10 years ago

reopened it. I'm not full sure if this works for all possible configurations but it probably doesn't hurt because it only affects the well-known urls Can someone create a pull request for this?

DeepDiver1975 commented 10 years ago

duplicate of #6588 -> let's continue there -> case closed