From 0c2a6d29bd62160f607a63340551e0d6db339b97 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 10 Feb 2026 16:15:47 -0500 Subject: [PATCH] skip htaccess rewrites on local env --- includes/Performance.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/Performance.php b/includes/Performance.php index f6e9d9dec..f69f78359 100644 --- a/includes/Performance.php +++ b/includes/Performance.php @@ -64,7 +64,9 @@ public function __construct( Container $container ) { $this->hooks(); new Cache( $container ); - new Skip404( $container ); + if ( Skip404::is_active( $container ) ) { + new Skip404( $container ); + } new PerformanceWPCLI(); new Constants( $container ); new CloudflareFeaturesManager( $container ); @@ -112,6 +114,11 @@ public function configureContainer( Container $container ) { global $is_apache; } + // Skip .htaccess modifications in local environments (e.g. wp-env, Docker) to avoid 500s from patch/regex issues. + if ( function_exists( 'wp_get_environment_type' ) && 'local' === wp_get_environment_type() ) { + $is_apache = false; + } + $container->set( 'isApache', $is_apache ); $container->set(