So Tag zusammen. Ich ringe mich dann mal durch hier im Forum nach hilfe zu suchen.
Zu meinem Problem. Ich habe eine Seite sagen wir https://mydomain.de diese kann auch durch https://www.mydomain.de erreicht werden. Aber in der url wird diese zu mydomain.de. Ich würde das aber gerne anders herrum machen. Ich lese mich schon seit Tagen darüber schlau und nichts zeigt Wirkung. Habt ihr veilleicht eine Hilfestellung für mich. Hier ist übrigens mein VHost in apache(2.4). Ich weiß da steht sicher sehr viel crap drin. Ordner und domain wurden von mir natürlich unkenntlich gemacht
Code
<VirtualHost *:80>
ServerName mydomain.de
ServerAdmin admin@mydomain.de
Redirect permanent / https://www.mydomain.de/
DocumentRoot /var/www/blöh/
<Directory /var/www/blöh/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>
<VirtualHost *:80>
ServerName http://www.mydomain.de
Redirect permanent / https://www.mydomain.de/
</VirtualHost>
Alles anzeigen
Apache Configuration
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName https://www.mydomain.de
ServerAdmin admin@mydomain.de
DocumentRoot /var/www/blöh/
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
RewriteEngine on
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
SSLCertificateFile /etc/ssl/asdf/schlüssel.pem
SSLCertificateKeyFile /etc/ssl/asdf/schlüssel/key.pem
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
Alles anzeigen