Wie wäre es mit folgendem Eintrag in der Konfig:
<VirtualHost *:80>
ServerName map.freifunk-rheinbach.de
DocumentRoot "/var/www/vhosts/map.freifunk-rheinbach.de"
Redirect permanent / https://map.freifunk-rheinbach.de/
</VirtualHost>
Mehr braucht es nicht.
Liebe Grüße
Thomas
On 04.09.19 14:47, Reindl Harald wrote:
>
> Am 04.09.19 um 14:34 schrieb Bernd Blana:
>> Hallo Zusammen,
>> ich habe ein Problem mit dem redirect mit http auf https, obwohl es in
>> der VirtualHost Datei eingetragen ist:
>>
>> RewriteEngine on
>> RewriteCond %{HTTPS} !=on [NC]
>> RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
>>
>> Wenn ich mit https die Seite aufrufe, bekomme ich sie einwandfrei
>> angezeigt. Rufe ich sie aber mit http auf, wird mir nur die " Apache2
>> Ubuntu Default Page" angezeigt. Es gibt kein redirect.
> Steht das oben im vhost oder irgendwo?
> Das Zeug muss in einen vhost für Port 80
>
> Bei aktuellen httpd Version geht auch ein Hybrid
>
> Es muss aber mindestens einen explizit konfigurierten SSL-Host geben
> sonst klappt das mit "SSLEngine Optional" nicht, dafür kannst du dir bei
> hundereten anderen den doppelten <VirtualHost>-Wahnsinn sparen
>
> <VirtualHost *:80 *:443>
> DocumentRoot "/var/www/htdocs"
> ServerName hostname
> <IfModule mod_rewrite.c>
> RewriteEngine On
> RewriteCond %{HTTPS} Off
> RewriteCond %{REQUEST_URI} !^\/\.well\-known\/acme\-challenge\/
> RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
> </IfModule>
> SSLEngine Optional
> SSLCertificateFile "conf/ssl/rsa.pem"
> SSLCertificateFile "conf/ssl/ecdsa.pem"
> </VirtualHost>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
--
Thomas Arend
Zingsheimstraße 31
53359 Rheinbach
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]