Seite 1 von 1

Umleitung auf https und www in Unterverzeichnis

Verfasst: 04.02.2016 20:06
von JonnyB
Hallo,

irgendwie bekomme ich das nicht auf die Reihe:
Alle Seiten sollen auf https umgeleitet werden, das funktioniert so weit. Aber domain.de soll auch auf https://www.domain.de/store/ umgeleitet werden.
Wenn ich www.domain.de/store aufrufe wird aber nicht auf https umgeleitet.
Wo habe ich einen Fehler?

Code: Alles auswählen

RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#end