XenForo and FrankenPHP (Modern PHP App Server)

Hi! For those of you that come across this in the future and want to save a few hours, here's a working config I figured out for FrankenPHP.

The config should be fairly similar for plain Caddy. This makes Friendly URLs work as well.

Code:
handle /xf/* {
    # Internal only
    @forums_internal path /xf/install/data/* /xf/install/templates/* /xf/internal_data/* /xf/library/* /xf/src/*
    error @forums_internal 404

    # Add trailing slash for directory requests
    @canonicalPath {
        file {path}/index.php
        not path */
    }
    redir @canonicalPath {path}/ 308

    try_files {path} {path}/index.php /xf/index.php?{path}&{query}

    @phpFiles path *.php
    php @phpFiles
    file_server
}
 
  • Love
Reactions: rdn
Back
Top Bottom