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.

This commit is contained in:
TheOnlyMace
2026-01-13 23:15:10 +01:00
parent 4382fd3e0b
commit ebb15eb5c2
13 changed files with 53 additions and 46 deletions

View File

@@ -23,19 +23,26 @@
RewriteCond %{HTTP_HOST} ^(www\.)?hexahost\.de$ [NC] RewriteCond %{HTTP_HOST} ^(www\.)?hexahost\.de$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 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} !-f
RewriteCond %{REQUEST_FILENAME} !-d 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 # HTML zu PHP Weiterleitungen (Legacy-Support)
RewriteRule ^index\.html$ index.php [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^about\.html$ about.php [L,R=301] RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^contact\.html$ contact.php [L,R=301] RewriteRule ^([^\.]+)\.html$ $1 [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]
</IfModule> </IfModule>
# Konfigurationsdateien schützen # Konfigurationsdateien schützen

View File

@@ -21,8 +21,8 @@ includeHeader($page_title, $page_description, $current_page);
<h1>Seite nicht gefunden</h1> <h1>Seite nicht gefunden</h1>
<p>Die angeforderte Seite existiert leider nicht oder wurde verschoben.</p> <p>Die angeforderte Seite existiert leider nicht oder wurde verschoben.</p>
<div class="error-actions"> <div class="error-actions">
<a href="index.php" class="btn btn-primary">Zur Startseite</a> <a href="/" class="btn btn-primary">Zur Startseite</a>
<a href="contact.php" class="btn btn-secondary">Kontakt aufnehmen</a> <a href="/contact" class="btn btn-secondary">Kontakt aufnehmen</a>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -21,8 +21,8 @@ includeHeader($page_title, $page_description, $current_page);
<h1>Interner Serverfehler</h1> <h1>Interner Serverfehler</h1>
<p>Es ist ein unerwarteter Fehler aufgetreten. Wir arbeiten bereits an der Lösung.</p> <p>Es ist ein unerwarteter Fehler aufgetreten. Wir arbeiten bereits an der Lösung.</p>
<div class="error-actions"> <div class="error-actions">
<a href="index.php" class="btn btn-primary">Zur Startseite</a> <a href="/" class="btn btn-primary">Zur Startseite</a>
<a href="contact.php" class="btn btn-secondary">Support kontaktieren</a> <a href="/contact" class="btn btn-secondary">Support kontaktieren</a>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -233,8 +233,8 @@ includeHeader($page_title, $page_description, $current_page);
<h2>Bereit für die Zusammenarbeit?</h2> <h2>Bereit für die Zusammenarbeit?</h2>
<p>Lassen Sie uns gemeinsam Ihre Hosting-Lösung entwickeln</p> <p>Lassen Sie uns gemeinsam Ihre Hosting-Lösung entwickeln</p>
<div class="cta-actions"> <div class="cta-actions">
<a href="contact.php" class="btn btn-primary">Kontakt aufnehmen</a> <a href="/contact" class="btn btn-primary">Kontakt aufnehmen</a>
<a href="vpc.php" class="btn btn-secondary">Produkte entdecken</a> <a href="/vpc" class="btn btn-secondary">Produkte entdecken</a>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -418,7 +418,7 @@ includeHeader($page_title, $page_description, $current_page);
</p> </p>
<p> <p>
(2) Einzelheiten zur Datenverarbeitung sind in der (2) Einzelheiten zur Datenverarbeitung sind in der
<a href="datenschutz.php">Datenschutzerklärung</a> geregelt. <a href="/datenschutz">Datenschutzerklärung</a> geregelt.
</p> </p>
<p> <p>
(3) Sofern der Kunde personenbezogene Daten Dritter auf den gemieteten (3) Sofern der Kunde personenbezogene Daten Dritter auf den gemieteten

View File

@@ -147,7 +147,7 @@ includeHeader($page_title, $page_description, $current_page, $additional_scripts
<div class="form-group checkbox-group"> <div class="form-group checkbox-group">
<label class="checkbox-label"> <label class="checkbox-label">
<input type="checkbox" id="privacy" name="privacy" required> <input type="checkbox" id="privacy" name="privacy" required>
Ich habe die <a href="datenschutz.php" target="_blank">Datenschutzerklärung</a> gelesen und stimme der Verarbeitung meiner Daten zu. * Ich habe die <a href="/datenschutz" target="_blank">Datenschutzerklärung</a> gelesen und stimme der Verarbeitung meiner Daten zu. *
</label> </label>
</div> </div>
<div class="form-actions"> <div class="form-actions">

View File

@@ -15,20 +15,20 @@
<div class="footer-section"> <div class="footer-section">
<h4>Produkte</h4> <h4>Produkte</h4>
<ul> <ul>
<li><a href="vpc.php">Virtual Private Container</a></li> <li><a href="/vpc">Virtual Private Container</a></li>
<li><a href="vps.php">Virtual Private Server</a></li> <li><a href="/vps">Virtual Private Server</a></li>
<li><a href="mail-gateway.php">Mail Gateway</a></li> <li><a href="/mail-gateway">Mail Gateway</a></li>
<li><a href="webhosting.php">Webhosting</a></li> <li><a href="/webhosting">Webhosting</a></li>
</ul> </ul>
</div> </div>
<div class="footer-section"> <div class="footer-section">
<h4>Unternehmen</h4> <h4>Unternehmen</h4>
<ul> <ul>
<li><a href="about.php">Über uns</a></li> <li><a href="/about">Über uns</a></li>
<li><a href="contact.php">Kontakt</a></li> <li><a href="/contact">Kontakt</a></li>
<li><a href="impressum.php">Impressum</a></li> <li><a href="/impressum">Impressum</a></li>
<li><a href="datenschutz.php">Datenschutz</a></li> <li><a href="/datenschutz">Datenschutz</a></li>
<li><a href="agb.php">AGB</a></li> <li><a href="/agb">AGB</a></li>
</ul> </ul>
</div> </div>
<div class="footer-section"> <div class="footer-section">

View File

@@ -16,23 +16,23 @@
<nav class="nav"> <nav class="nav">
<div class="nav-container"> <div class="nav-container">
<div class="nav-logo"> <div class="nav-logo">
<a href="index.php"> <a href="/">
<img src="https://cdn.hexahost.de/assets/img/logo/8iFs123BynHQWHI5.png" alt="HexaHost.de Logo" class="logo-image"> <img src="https://cdn.hexahost.de/assets/img/logo/8iFs123BynHQWHI5.png" alt="HexaHost.de Logo" class="logo-image">
</a> </a>
</div> </div>
<ul class="nav-menu"> <ul class="nav-menu">
<li><a href="index.php" class="nav-link <?php echo ($current_page === 'home') ? 'active' : ''; ?>">Home</a></li> <li><a href="/" class="nav-link <?php echo ($current_page === 'home') ? 'active' : ''; ?>">Home</a></li>
<li class="nav-dropdown"> <li class="nav-dropdown">
<a href="#" class="nav-link <?php echo (in_array($current_page, ['vpc', 'vps', 'mail-gateway', 'webhosting'])) ? 'active' : ''; ?>">Produkte</a> <a href="#" class="nav-link <?php echo (in_array($current_page, ['vpc', 'vps', 'mail-gateway', 'webhosting'])) ? 'active' : ''; ?>">Produkte</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="vpc.php" class="<?php echo ($current_page === 'vpc') ? 'active' : ''; ?>">Virtual Private Container</a></li> <li><a href="/vpc" class="<?php echo ($current_page === 'vpc') ? 'active' : ''; ?>">Virtual Private Container</a></li>
<li><a href="vps.php" class="<?php echo ($current_page === 'vps') ? 'active' : ''; ?>">Virtual Private Server</a></li> <li><a href="/vps" class="<?php echo ($current_page === 'vps') ? 'active' : ''; ?>">Virtual Private Server</a></li>
<li><a href="mail-gateway.php" class="<?php echo ($current_page === 'mail-gateway') ? 'active' : ''; ?>">Mail Gateway</a></li> <li><a href="/mail-gateway" class="<?php echo ($current_page === 'mail-gateway') ? 'active' : ''; ?>">Mail Gateway</a></li>
<li><a href="webhosting.php" class="<?php echo ($current_page === 'webhosting') ? 'active' : ''; ?>">Webhosting</a></li> <li><a href="/webhosting" class="<?php echo ($current_page === 'webhosting') ? 'active' : ''; ?>">Webhosting</a></li>
</ul> </ul>
</li> </li>
<li><a href="about.php" class="nav-link <?php echo ($current_page === 'about') ? 'active' : ''; ?>">Über uns</a></li> <li><a href="/about" class="nav-link <?php echo ($current_page === 'about') ? 'active' : ''; ?>">Über uns</a></li>
<li><a href="contact.php" class="nav-link <?php echo ($current_page === 'contact') ? 'active' : ''; ?>">Kontakt</a></li> <li><a href="/contact" class="nav-link <?php echo ($current_page === 'contact') ? 'active' : ''; ?>">Kontakt</a></li>
</ul> </ul>
<div class="nav-toggle"> <div class="nav-toggle">
<span></span> <span></span>

View File

@@ -25,7 +25,7 @@ includeHeader($page_title, $page_description, $current_page);
</p> </p>
<div class="hero-actions"> <div class="hero-actions">
<a href="#products" class="btn btn-primary">Produkte entdecken</a> <a href="#products" class="btn btn-primary">Produkte entdecken</a>
<a href="contact.php" class="btn btn-secondary">Kontakt aufnehmen</a> <a href="/contact" class="btn btn-secondary">Kontakt aufnehmen</a>
</div> </div>
</div> </div>
<div class="hero-visual"> <div class="hero-visual">
@@ -72,7 +72,7 @@ includeHeader($page_title, $page_description, $current_page);
<li>DDoS Protection</li> <li>DDoS Protection</li>
<li>99.9% Uptime</li> <li>99.9% Uptime</li>
</ul> </ul>
<a href="vpc.php" class="btn btn-primary">Mehr erfahren</a> <a href="/vpc" class="btn btn-primary">Mehr erfahren</a>
</div> </div>
<div class="product-card glass-card"> <div class="product-card glass-card">
<div class="product-icon"> <div class="product-icon">
@@ -90,7 +90,7 @@ includeHeader($page_title, $page_description, $current_page);
<li>Backup-Service</li> <li>Backup-Service</li>
<li>24/7 Monitoring</li> <li>24/7 Monitoring</li>
</ul> </ul>
<a href="vps.php" class="btn btn-primary">Mehr erfahren</a> <a href="/vps" class="btn btn-primary">Mehr erfahren</a>
</div> </div>
<div class="product-card glass-card"> <div class="product-card glass-card">
<div class="product-icon"> <div class="product-icon">
@@ -107,7 +107,7 @@ includeHeader($page_title, $page_description, $current_page);
<li>Webmail Interface</li> <li>Webmail Interface</li>
<li>Mobile Sync</li> <li>Mobile Sync</li>
</ul> </ul>
<a href="mail-gateway.php" class="btn btn-primary">Mehr erfahren</a> <a href="/mail-gateway" class="btn btn-primary">Mehr erfahren</a>
</div> </div>
<div class="product-card glass-card"> <div class="product-card glass-card">
<div class="product-icon"> <div class="product-icon">
@@ -127,7 +127,7 @@ includeHeader($page_title, $page_description, $current_page);
<li>Automatische Backups</li> <li>Automatische Backups</li>
<li>PHP & MySQL</li> <li>PHP & MySQL</li>
</ul> </ul>
<a href="webhosting.php" class="btn btn-primary">Mehr erfahren</a> <a href="/webhosting" class="btn btn-primary">Mehr erfahren</a>
</div> </div>
</div> </div>
</div> </div>
@@ -196,8 +196,8 @@ includeHeader($page_title, $page_description, $current_page);
<h2>Bereit für zuverlässiges Hosting?</h2> <h2>Bereit für zuverlässiges Hosting?</h2>
<p>Starten Sie noch heute mit HexaHost und erleben Sie den Unterschied</p> <p>Starten Sie noch heute mit HexaHost und erleben Sie den Unterschied</p>
<div class="cta-actions"> <div class="cta-actions">
<a href="contact.php" class="btn btn-primary">Jetzt starten</a> <a href="/contact" class="btn btn-primary">Jetzt starten</a>
<a href="about.php" class="btn btn-secondary">Mehr über uns</a> <a href="/about" class="btn btn-secondary">Mehr über uns</a>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -320,7 +320,7 @@ includeHeader($page_title, $page_description, $current_page);
<p>Starten Sie noch heute mit unserem Mail Gateway</p> <p>Starten Sie noch heute mit unserem Mail Gateway</p>
<div class="cta-actions"> <div class="cta-actions">
<a href="contact.php?product=mail-gateway" class="btn btn-primary">Jetzt bestellen</a> <a href="contact.php?product=mail-gateway" class="btn btn-primary">Jetzt bestellen</a>
<a href="contact.php" class="btn btn-secondary">Beratung anfordern</a> <a href="/contact" class="btn btn-secondary">Beratung anfordern</a>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -333,7 +333,7 @@ includeHeader($page_title, $page_description, $current_page);
<p>Starten Sie noch heute mit einem Virtual Private Container</p> <p>Starten Sie noch heute mit einem Virtual Private Container</p>
<div class="cta-actions"> <div class="cta-actions">
<a href="contact.php?product=vpc" class="btn btn-primary">Jetzt bestellen</a> <a href="contact.php?product=vpc" class="btn btn-primary">Jetzt bestellen</a>
<a href="contact.php" class="btn btn-secondary">Beratung anfordern</a> <a href="/contact" class="btn btn-secondary">Beratung anfordern</a>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -337,7 +337,7 @@ includeHeader($page_title, $page_description, $current_page);
<p>Starten Sie noch heute mit einem Virtual Private Server</p> <p>Starten Sie noch heute mit einem Virtual Private Server</p>
<div class="cta-actions"> <div class="cta-actions">
<a href="contact.php?product=vps" class="btn btn-primary">Jetzt bestellen</a> <a href="contact.php?product=vps" class="btn btn-primary">Jetzt bestellen</a>
<a href="contact.php" class="btn btn-secondary">Beratung anfordern</a> <a href="/contact" class="btn btn-secondary">Beratung anfordern</a>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -336,7 +336,7 @@ includeHeader($page_title, $page_description, $current_page);
<p>Starten Sie noch heute mit professionellem Webhosting</p> <p>Starten Sie noch heute mit professionellem Webhosting</p>
<div class="cta-actions"> <div class="cta-actions">
<a href="contact.php?product=webhosting" class="btn btn-primary">Jetzt bestellen</a> <a href="contact.php?product=webhosting" class="btn btn-primary">Jetzt bestellen</a>
<a href="contact.php" class="btn btn-secondary">Beratung anfordern</a> <a href="/contact" class="btn btn-secondary">Beratung anfordern</a>
</div> </div>
</div> </div>
</div> </div>