Skip to content

Commit 0c2a6d2

Browse files
committed
skip htaccess rewrites on local env
1 parent bb99d25 commit 0c2a6d2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

includes/Performance.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ public function __construct( Container $container ) {
6464
$this->hooks();
6565

6666
new Cache( $container );
67-
new Skip404( $container );
67+
if ( Skip404::is_active( $container ) ) {
68+
new Skip404( $container );
69+
}
6870
new PerformanceWPCLI();
6971
new Constants( $container );
7072
new CloudflareFeaturesManager( $container );
@@ -112,6 +114,11 @@ public function configureContainer( Container $container ) {
112114
global $is_apache;
113115
}
114116

117+
// Skip .htaccess modifications in local environments (e.g. wp-env, Docker) to avoid 500s from patch/regex issues.
118+
if ( function_exists( 'wp_get_environment_type' ) && 'local' === wp_get_environment_type() ) {
119+
$is_apache = false;
120+
}
121+
115122
$container->set( 'isApache', $is_apache );
116123

117124
$container->set(

0 commit comments

Comments
 (0)