0

Did anyone ever try to setup a sabredav caldav server in laravel? Sabredav needs the calendarserver to be access at "calendarserver.php/" <-- trailing slash

Sabredav needs a trailing slash which is trimmed by laravel. I tried to alter the htaccess file:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/calendarserver\.php
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

But it seems, that I also need to configure a route, which again will trim the slash. Basically, I just want everyone to able to access the /calendarserver.php/ path without laravel interfering. Is there any clean way to accomplish that?

Any help would be greatly appreciated!

Thanks.

  • The big question is: what is the point of getting the requests routed through lavarel? This doesn't seem very useful. – Evert May 16 '16 at 01:07
  • Thanks. Exactly! I chose to put the cal dav server on a subdomain, to keep things clear. – user6163206 May 19 '16 at 06:59
  • That sounds like a better approach! You can still integrate with lavarel's services, just make sure you don't go through the routing system. – Evert May 19 '16 at 18:59
  • Do you have any experience setting this up? Using subdomains isn't working, because they are still covered by their routing system. I'm trying to test this locally be adding a non-laravel project to homestead, which also isn't working. – user6163206 Jun 04 '16 at 21:52
  • ultimately *something* is rewriting all your HTTP requests to laravel's index.php (or whatever they use) You need to solve this on a webserver (or .htaccess)-level. – Evert Jun 04 '16 at 21:54

0 Answers0