No .php extension in Caddy?

In .htaccess I could redirect/rewrite index.php to index, and index.html to index.
I’ve tried the same in Caddy doing the following:

{
    local_certs
}

rofl.test

root * /Users/Name/Sites/caddyprojects/rofl

#Tried this:
try_files {path}.php {path}

#Need this try_files to auto-find index
try_files {path} /index.php
file_server browse

This shows the index.php file when going to rolf.test/lol instead of lol.php.

I think you’re looking for the php_fastcgi directive:

You’ll need to install and run PHP-FPM to use PHP with Caddy.

This topic was automatically closed after 30 days. New replies are no longer allowed.