PHP settings and .htaccess
Why .htaccess has no effect, clean URLs, document root, upload limit, blocked paths and custom rules.
2 min read
On this page
No Apache, no .htaccess
PHP projects run on FrankenPHP, a web server based on Caddy. It does not read .htaccess. Any redirects and blocks in there have no effect with us. Most of those rules are not needed; for the rest there are the settings below.
The settings
PHP projects have these settings:
Clean URLs. /contact serves contact.php, and so does /contact/, as long as there is no folder contact/. This replaces the usual RewriteRule from .htaccess.
Document root. The folder that is reachable on the web, for example public for Laravel. Empty means the whole project. A change needs a new build.
Upload limit. The largest file PHP accepts, in MB, at most 256.
Blocked paths. One path per line, at most 50, for example /config or /install. Everything below answers with 404. Hidden files such as .env or .git are always blocked, except /.well-known/.
Custom rules. For cases not covered above, you write Caddy rules, up to 8 KB. They come before PHP serving:
redir /old /new 301
header /assets/* Cache-Control "public, max-age=31536000"If the repository contains its own Caddyfile, the build uses it. The settings here then do not apply.
Configuration files
Many PHP apps want a file with credentials, for example config/database.php. It does not belong in the repository. Create it in the Files tab under Configuration files. More in Databases, files and storage.