]> juplo.de Git - website/commitdiff
WIP:debug-redirect
authorKai Moritz <kai@juplo.de>
Thu, 20 Nov 2025 21:44:08 +0000 (22:44 +0100)
committerKai Moritz <kai@juplo.de>
Thu, 20 Nov 2025 21:44:08 +0000 (22:44 +0100)
docker-compose.yml
wordpress/wp-content/mu-plugins/debug-redirects.php [new file with mode: 0644]

index 50fc498b1cb7ffa5b2d4add0e80c2f10bdebb7c9..d2ad6ff7021b7ce2ee09885ba517ae83d07927ca 100644 (file)
@@ -22,7 +22,7 @@ services:
       WORDPRESS_DB_NAME: wp_juplo
       WORDPRESS_DB_CHARSET: latin1
       WORDPRESS_DB_COLLATE: latin1_general_ci
-      WORDPRESS_DEBUG: true
+      WORDPRESS_DEBUG: 1
       WORDPRESS_SECRET_KEY: vTelcON5v26YTrdtKfMvyYFuetRwaWyK2K4tfalgpr
       WORDPRESS_TABLE_PREFIX: ''
     ports:
@@ -33,6 +33,7 @@ services:
     volumes:
       - ./wordpress/wp-config.php:/usr/src/wordpress/wp-config.php:ro
       - ./wordpress/wp-content/themes/juplo-theme:/usr/src/wordpress/wp-content/themes/juplo-theme:ro
+      - ./wordpress/wp-content/mu-plugins/debug-redirects.php:/usr/src/wordpress/wp-content/mu-plugins/debug-redirects.php:ro
       - ./wordpress/wp-content/plugins/classic-editor:/usr/src/wordpress/wp-content/plugins/classic-editor:ro
       - ./wordpress/wp-content/plugins/google-analytics-for-wordpress:/usr/src/wordpress/wp-content/plugins/google-analytics-for-wordpress:ro
       - ./wordpress/wp-content/plugins/google-sitemap-generator:/usr/src/wordpress/wp-content/plugins/google-sitemap-generator:ro
diff --git a/wordpress/wp-content/mu-plugins/debug-redirects.php b/wordpress/wp-content/mu-plugins/debug-redirects.php
new file mode 100644 (file)
index 0000000..06f07ce
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+// Loggt alle Redirects
+add_filter('wp_redirect', function($location, $status) {
+    error_log("HTTP_HOST = " . ($_SERVER['HTTP_HOST'] ?? 'not set'));
+    error_log("SERVER_NAME = " . ($_SERVER['SERVER_NAME'] ?? 'not set'));
+    error_log("HTTPS = " . ($_SERVER['HTTPS'] ?? 'not set'));
+    error_log("SERVER_PORT = " . ($_SERVER['SERVER_PORT'] ?? 'not set'));
+    error_log("HTTP_X_FORWARDED_PROTO = " . ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? 'not set'));
+    error_log("WP REDIRECT FROM: " . $_SERVER['REQUEST_URI']);
+    error_log("WP REDIRECT TO:   " . $location);
+    error_log("STATUS:           " . $status);
+    return $location;
+}, 10, 2);
+
+// Optional: alle Redirects verhindern
+// add_filter('wp_redirect', '__return_false');
+