WordPress Pretty Permalinks in Caddy v2

Hey @francislavoie I’ve done a completely fresh install of WordPress and still having this issue.

I’ve included the Caddyfile and wp-config.php below. I’ve also checked the database to confirm there aren’t any strings including index.php. The only one I could see was the permalink_structure key in the wp_options table, set to /index.php/%postname%/ but this is the same as in my previous screenshot, I can’t change this value via the WP dashboard.

I am using wp core download to fetch the WordPress files, then wp config create to generate the wp-config.php file. I have also tried creating the config file via the WordPress UI, but the result is the same.

Caddyfile

example.localhost {
	root * /home/james/Development/example.com
	encode gzip
	php_fastcgi unix//var/run/php/php8.1-fpm.sock
	file_server
}

wp-config.php

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the installation.
 * You don't have to use the web site, you can copy this file to "wp-config.php"
 * and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * Database settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://wordpress.org/support/article/editing-wp-config-php/
 *
 * @package WordPress
 */

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'example' );

/** Database username */
define( 'DB_USER', 'root' );

/** Database password */
define( 'DB_PASSWORD', 'password' );

/** Database hostname */
define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

/**#@+
 * Authentication unique keys and salts.
 *
 * Change these to different unique phrases! You can generate these using
 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
 *
 * You can change these at any point in time to invalidate all existing cookies.
 * This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define( 'AUTH_KEY',         ' Y~Wy[3HlHbH;FytH.aa2}Y<cu>++jwk0I:x}R/oMe!UP$`X rq4h^gfhIbFZphx' );
define( 'SECURE_AUTH_KEY',  'SV1Yp#4]/1=y&%PG<cdU}YUst^xccaYT2>+@xl5tC=v)<pn(Si zd4L*L/<mE|JF' );
define( 'LOGGED_IN_KEY',    'm28y.<UH~KfDNhLd$k2lJ,wL_:ZwMIZeY`_6Ym$<A2^lmOF8dVf4(g{13+p;{=U7' );
define( 'NONCE_KEY',        'j?!><8Mv9!gWgq@|lsrli8L_}G@AjLe.G~RZ@Ha!,0A~*@}<*JCE-@VZT6bcIrWk' );
define( 'AUTH_SALT',        'Z=Z$T8}VV;WMx 5NhHdYsfR`9?7gQP|rOd[-|bfL<TgIei+ptwCs/YKz23 @ ,di' );
define( 'SECURE_AUTH_SALT', 'c~I:LJQ393xSs%(~Hd@2Tm2G9Q93iGj&zA4ZIg<m+>Iv08f+/Ous<`MI{z*T+qAU' );
define( 'LOGGED_IN_SALT',   'qV9i6n=<Fv2BjLh~F|FL36?.Z_ harH/zx1J>Zlem~Q/j9], s,f#]g[P03McF~4' );
define( 'NONCE_SALT',       'v}URPPas<[M*8Y[M&@YlF8nz5<W8[=-gB(yG~*1o~H+r<7l~Yd<Lsx;7Q> ^Oi`@' );

/**#@-*/

/**
 * WordPress database table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 *
 * @link https://wordpress.org/support/article/debugging-in-wordpress/
 */
define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */



/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
	define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';