Implement 301 redirects for www to non-www and enhance canonical tag handling

This commit adds 301 redirects in the Apache configuration to redirect traffic from www.tt-tagebuch.de to tt-tagebuch.de for both HTTP and HTTPS. Additionally, it introduces middleware in the backend to dynamically set canonical tags based on the request URL, ensuring proper SEO practices. The request logging middleware has been disabled, and sensitive data handling has been improved in the MyTischtennis model and API logging service, ensuring compliance with data protection regulations. Frontend updates include enhanced descriptions and features in the application, improving user experience and clarity.
This commit is contained in:
Torsten Schulz (local)
2025-11-16 12:08:56 +01:00
parent de36a8ce2b
commit 5b04ed7904
12 changed files with 1201 additions and 146 deletions

View File

@@ -8,9 +8,29 @@
# sudo a2enmod headers
# sudo systemctl restart apache2
# 301-Weiterleitung von www auf non-www (HTTP)
<VirtualHost *:80>
ServerName www.tt-tagebuch.de
Redirect permanent / https://tt-tagebuch.de/
</VirtualHost>
<VirtualHost *:80>
ServerName tt-tagebuch.de
Redirect permanent / https://tt-tagebuch.de/
</VirtualHost>
# 301-Weiterleitung von www auf non-www (HTTPS)
<VirtualHost *:443>
ServerName www.tt-tagebuch.de
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/tt-tagebuch.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/tt-tagebuch.de/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
Redirect permanent / https://tt-tagebuch.de/
</VirtualHost>
<VirtualHost *:443>
ServerName tt-tagebuch.de
ServerAlias www.tt-tagebuch.de
DocumentRoot /var/www/tt-tagebuch.de