Alternative for not_starts_with

I have a PHP application that has a front controller, that has a single PHP file to handle requests. To deploy this application, I need to route all requests to this file, except for /assets/:

http:// {
  fastcgi / php
  rewrite {
    if {path} not_starts_with /assets/
    to {path} /index.php?{query}

Unfortunately, it appears that Caddy 0.10.3 (the latest version, at the time of this writing) doesn’t support not_starts_with, is there something else I could use?

You could build from source, or wait until 0.10.4 comes out. Should be this week, hopefully.

1 Like

You can use regex.

if {path} not_match ^\/assets\/

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.