From ebb15eb5c2cc403baff097ad21f217df907f6305 Mon Sep 17 00:00:00 2001 From: TheOnlyMace <0815cracky@gmail.com> Date: Tue, 13 Jan 2026 23:15:10 +0100 Subject: [PATCH] Refactor URL handling and improve navigation: Updated .htaccess for cleaner URL structure by removing .php extensions and redirecting to clean URLs. Modified various pages to use absolute paths for links, enhancing consistency and user experience. Updated error pages and footer links accordingly. --- public/.htaccess | 27 +++++++++++++++++---------- public/404.php | 4 ++-- public/500.php | 4 ++-- public/about.php | 4 ++-- public/agb.php | 2 +- public/contact.php | 2 +- public/includes/footer.php | 18 +++++++++--------- public/includes/header.php | 16 ++++++++-------- public/index.php | 14 +++++++------- public/mail-gateway.php | 2 +- public/vpc.php | 2 +- public/vps.php | 2 +- public/webhosting.php | 2 +- 13 files changed, 53 insertions(+), 46 deletions(-) diff --git a/public/.htaccess b/public/.htaccess index 9238bf3..860efcc 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -23,19 +23,26 @@ RewriteCond %{HTTP_HOST} ^(www\.)?hexahost\.de$ [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] - # HTML zu PHP Weiterleitungen + # PHP-Endung aus URLs entfernen + # Schritt 1: Wenn .php in URL, weiterleiten auf saubere URL (301) + RewriteCond %{THE_REQUEST} \s/([^.]+)\.php[\s?] [NC] + RewriteCond %{REQUEST_URI} !^/(contact-handler|config/) + RewriteRule ^(.+)\.php$ /$1 [R=301,L] + + # Schritt 2: index.php zur Startseite weiterleiten + RewriteCond %{THE_REQUEST} \s/index\.php[\s?] [NC] + RewriteRule ^index\.php$ / [R=301,L] + + # Schritt 3: Saubere URLs intern auf .php-Dateien umleiten RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^([^\.]+)\.html$ $1.php [L,R=301] + RewriteCond %{REQUEST_FILENAME}.php -f + RewriteRule ^(.+)$ $1.php [L] - # Direkte HTML zu PHP Weiterleitungen für bekannte Seiten - RewriteRule ^index\.html$ index.php [L,R=301] - RewriteRule ^about\.html$ about.php [L,R=301] - RewriteRule ^contact\.html$ contact.php [L,R=301] - RewriteRule ^vpc\.html$ vpc.php [L,R=301] - RewriteRule ^vps\.html$ vps.php [L,R=301] - RewriteRule ^webhosting\.html$ webhosting.php [L,R=301] - RewriteRule ^mail-gateway\.html$ mail-gateway.php [L,R=301] + # HTML zu PHP Weiterleitungen (Legacy-Support) + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^([^\.]+)\.html$ $1 [L,R=301] # Konfigurationsdateien schützen diff --git a/public/404.php b/public/404.php index 39dcdfe..4d17444 100644 --- a/public/404.php +++ b/public/404.php @@ -21,8 +21,8 @@ includeHeader($page_title, $page_description, $current_page);
Die angeforderte Seite existiert leider nicht oder wurde verschoben.
diff --git a/public/500.php b/public/500.php index e5c6ea6..cda8d41 100644 --- a/public/500.php +++ b/public/500.php @@ -21,8 +21,8 @@ includeHeader($page_title, $page_description, $current_page);Es ist ein unerwarteter Fehler aufgetreten. Wir arbeiten bereits an der Lösung.
diff --git a/public/about.php b/public/about.php index 4c45697..2f5aa77 100644 --- a/public/about.php +++ b/public/about.php @@ -233,8 +233,8 @@ includeHeader($page_title, $page_description, $current_page);Lassen Sie uns gemeinsam Ihre Hosting-Lösung entwickeln
diff --git a/public/agb.php b/public/agb.php index e7994f3..d82452f 100644 --- a/public/agb.php +++ b/public/agb.php @@ -418,7 +418,7 @@ includeHeader($page_title, $page_description, $current_page);(2) Einzelheiten zur Datenverarbeitung sind in der - Datenschutzerklärung geregelt. + Datenschutzerklärung geregelt.
(3) Sofern der Kunde personenbezogene Daten Dritter auf den gemieteten diff --git a/public/contact.php b/public/contact.php index c3c3ed8..e5d8565 100644 --- a/public/contact.php +++ b/public/contact.php @@ -147,7 +147,7 @@ includeHeader($page_title, $page_description, $current_page, $additional_scripts
Starten Sie noch heute mit einem Virtual Private Container
diff --git a/public/vps.php b/public/vps.php index 08fc4c0..2b061ec 100644 --- a/public/vps.php +++ b/public/vps.php @@ -337,7 +337,7 @@ includeHeader($page_title, $page_description, $current_page);Starten Sie noch heute mit einem Virtual Private Server
diff --git a/public/webhosting.php b/public/webhosting.php index 18e1cbd..143321f 100644 --- a/public/webhosting.php +++ b/public/webhosting.php @@ -336,7 +336,7 @@ includeHeader($page_title, $page_description, $current_page);Starten Sie noch heute mit professionellem Webhosting